home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / altvb103.zip / DEMON.BAS < prev    next >
BASIC Source File  |  1993-05-08  |  89KB  |  2,179 lines

  1. ' DEMON.BAS     this program illustrates some of the ways that the routines
  2. '               provided in the Libraries in this package, can enhance your
  3. '               Visual BASIC DOS programs.
  4. '
  5. '   Author:     Christy Gemmell
  6. '   For:        ALT-VBDos
  7. '   Version:    1.03
  8. '   Date:       21/3/1993
  9. '
  10. '   MicroSoft Visual BASIC for DOS Standard and Professional editions.
  11. '   Assembler routines created with MicroSoft Macro Assembler MASM 6.0
  12. '
  13. '   Compile:    BC /E/O/S/X demon;
  14. '   Link:       Link /E/F demon,,,altvbdos.lib;
  15. '   IDE:        VBDOS demon.bas /L altvbdos.qlb
  16. '
  17. '   $DYNAMIC                             ' required for stringsort routine
  18. '
  19. '┌────────────────────────────────────────────────────────────────────────┐
  20. '│      External Functions and Procedures.                                │
  21. '└────────────────────────────────────────────────────────────────────────┘
  22. '
  23. '   The following prototypes refer to assembly-language procedures which
  24. '   are in the library files ALTVBDOS.LIB and ALTVBDOS.QLB. One or other
  25. '   of these libraries must be linked to the program which calls them.
  26. '
  27.     DECLARE FUNCTION Attribute% (BYVAL Fore%, BYVAL Back%)
  28.     DECLARE FUNCTION CapsLock% (BYVAL Switch%)
  29.     DECLARE FUNCTION Cpu% ()
  30.     DECLARE FUNCTION EmsError% ()
  31.     DECLARE FUNCTION EmsFrame% ()
  32.     DECLARE FUNCTION EmsOwned% (BYVAL Handle%)
  33.     DECLARE FUNCTION EmsPages% (BYVAL Switch%)
  34.     DECLARE FUNCTION EmsPresent% ()
  35.     DECLARE FUNCTION EmsVersion% ()
  36.     DECLARE FUNCTION FarPeek% (BYVAL Segment&, BYVAL OffSet&)
  37.     DECLARE FUNCTION FreeSpace& (BYVAL DriveNo%)
  38.     DECLARE FUNCTION KeyFlags% ()
  39.     DECLARE FUNCTION KeyIn% ()
  40.     DECLARE FUNCTION KeyStat% ()
  41.     DECLARE FUNCTION MathsChip% ()
  42.     DECLARE FUNCTION MouseInit% ()
  43.     DECLARE FUNCTION NumLock% (BYVAL Switch%)
  44.     DECLARE FUNCTION PeekWord& (BYVAL Segment&, BYVAL OffSet&)
  45.     DECLARE FUNCTION PrinTest% (BYVAL Printr%)
  46.     DECLARE FUNCTION Rand% (BYVAL Lower%, BYVAL Higher%)
  47.     DECLARE FUNCTION ScrLock% (BYVAL Switch%)
  48.     DECLARE FUNCTION FileSize& (FileSpec$)
  49.     DECLARE FUNCTION StatusLine% (Message$)
  50.     DECLARE FUNCTION StringScan% (Trgt$, BYVAL Size%, BYVAL Strt%, BYVAL Addr%)
  51.     DECLARE FUNCTION Verify% (BYVAL Default%, BYVAL Row%, Prompt$, BYVAL Attr%, BYVAL Mouse%)
  52.     DECLARE SUB BackFill (BYVAL Row%, BYVAL Col%, BYVAL Rows%, BYVAL Cols%, BYVAL Attr%)
  53.     DECLARE SUB Cipher (Text$, KeyWord$)
  54.     DECLARE SUB ClearEnd (BYVAL Switch%, BYVAL Attr%)
  55.     DECLARE SUB Curtains (BYVAL Speed%, BYVAL Attr%)
  56.     DECLARE SUB DOSBox (BYVAL Switch%, BYVAL Y1%, BYVAL X1%, BYVAL Y2%, BYVAL X2%, BYVAL Attr%)
  57.     DECLARE SUB EmsGet (BYVAL Segment%, BYVAL OffSet%, BYVAL Length%, BYVAL Page%, BYVAL Handle%, Done%)
  58.     DECLARE SUB EmsPut (BYVAL Segment%, BYVAL OffSet%, BYVAL Length%, BYVAL Page%, BYVAL Handle%, Done%)
  59.     DECLARE SUB EmsRelease (BYVAL Handle%)
  60.     DECLARE SUB EmsRequest (BYVAL Pages%, Handle%)
  61.     DECLARE SUB FastPrint (BYVAL Row%, BYVAL Col%, Message$, BYVAL Attr%)
  62.     DECLARE SUB GraPrint (BYVAL xLoc%, BYVAL yLoc%, Text$, BYVAL Attr%, BYVAL Scale%)
  63.     DECLARE SUB HelpMate (BYVAL Colour%, Title$, BYVAL Context%, Topic$)
  64.     DECLARE SUB KeyFlush ()
  65.     DECLARE SUB MisTake (BYVAL Row%, Message$, BYVAL Attr%, BYVAL Mouse%)
  66.     DECLARE SUB MouseHide ()
  67.     DECLARE SUB MouseNow (LeftButton%, RightButton%, xMouse%, yMouse%)
  68.     DECLARE SUB MouseShow ()
  69.     DECLARE SUB Pause (BYVAL Ticks%)
  70.     DECLARE SUB PerCentBox (BYVAL Switch%, Message$, BYVAL Attr%, BYVAL PerCent%)
  71.     DECLARE SUB PopUp (BYVAL Row%, BYVAL Col%, BYVAL Hght%, BYVAL Wdth%, BYVAL Attr%, BYVAL Brdr%, BYVAL Shdw%, BYVAL Zoom%)
  72.     DECLARE SUB PrintSet (BYVAL Row%, BYVAL Col%, BYVAL Attr%, BYVAL Printr%, BYVAL Mouse%)
  73.     DECLARE SUB ReSeed (BYVAL Seed&)
  74.     DECLARE SUB Scroll (BYVAL Dir%, BYVAL Y1%, BYVAL X1%, BYVAL Y2%, BYVAL X2%, BYVAL Units%, BYVAL Attr%)
  75.     DECLARE SUB ShutUp (BYVAL Speed%)
  76.     DECLARE SUB StringSort (BYVAL Dir%, BYVAL Size%, BYVAL Addr%)
  77.     DECLARE SUB VGALoad (File$)
  78.     DECLARE SUB VGAPan (BYVAL X%, BYVAL Y%)
  79.     DECLARE SUB VGASave (File$)
  80.  
  81. '   These are native QuickBASIC procedures which are in ALTVBDOS.LIB/QLB
  82. '
  83.     DECLARE FUNCTION BinDec& (Binary$)
  84.     DECLARE FUNCTION BitTest% (Number%, Bit%)
  85.     DECLARE FUNCTION DateInput$ (Default$, Context%, Topic$, HotKey%)
  86.     DECLARE FUNCTION DosVersion$ ()
  87.     DECLARE FUNCTION FindFile$ (FileSpec$, Attr%, Mouse%)
  88.     DECLARE FUNCTION GetFlag% (Flag%)
  89.     DECLARE FUNCTION GrAttrib% (ForeGround%, BackGround%)
  90.     DECLARE FUNCTION IsDir% (Test$)
  91.     DECLARE FUNCTION LongDate$ (Dy%, Mnth%, Yr%)
  92.     DECLARE FUNCTION RevInput$ (Max%, Visible%, Default$, Legal$, Ctx%, Topic$, Mask%, HotKey%)
  93.     DECLARE SUB BarMenu (P1%, P2%, P3%, Menu$(), P5%, P6%, P7%, P8$, Mouse%, HotKeys%)
  94.     DECLARE SUB CheckPrinter (Printr%)
  95.     DECLARE SUB Panel (Row%, Col%, Rows%, Cols%, Border%, Attr%)
  96.     DECLARE SUB SetFlag (Flag%, Setting%)
  97.     DECLARE SUB SortFile (PathName$, OffSet%, FieldLen%, RecordLen%, Done%)
  98.     DECLARE SUB VerMenu (P1%, P2%, P3%, P4%, P5%, P6$, Menu$(), P8%, P9%, P10%, P11%, P12$, Mouse%, HotKeys%)
  99.     DECLARE SUB VideoMode (Colour%, MaxRes%, VideoRam%)
  100.  
  101. '   Local, program-specific, functions and procedures.
  102. '
  103.     DECLARE SUB Frame (Title$, Switch%)
  104.  
  105. '┌────────────────────────────────────────────────────────────────────────┐
  106. '│      Initialisation.                                                   │
  107. '└────────────────────────────────────────────────────────────────────────┘
  108. '
  109.     CONST FALSE = 0, TRUE = NOT FALSE
  110.  
  111. '   Allow plenty of stack space for function and procedure calls.
  112. '
  113.     CLS: CLEAR , , &H2000
  114.  
  115. '   Establish error trapping and point to error handler.
  116. '
  117.     ON ERROR GOTO Trap
  118.  
  119. '   Check video capabilities of the host system (default to MDA).
  120. '
  121.     Colour% = FALSE                             ' Default to monochrome
  122.     MaxRes% = 0                                 ' Default to text only
  123.     VideoRam% = 4                               ' Default to 4K buffer
  124.  
  125.     VideoMode Colour%, MaxRes%, VideoRam%       ' Find what's installed
  126.  
  127. '   Set display colours for colour and monochrome displays.
  128. '
  129.     IF Colour% THEN
  130.        BarColour% = 48                          ' Black on Cyan
  131.        HeadColour% = 31                         ' Bright White on Blue
  132.        StatColour% = 48                         ' Black on Cyan
  133.        TextColour% = 112                        ' Black on White
  134.     ELSE
  135.        BarColour% = 112                         ' Reverse video
  136.        HeadColour% = 15                         ' Intense White on Black
  137.        StatColour% = 112                        ' Reverse video
  138.        TextColour% = 7                          ' White on Black
  139.     END IF
  140.  
  141. '   Check the type of display adaptor installed.
  142. '
  143.     SELECT CASE MaxRes%
  144.         CASE 13
  145.              IF VideoRam% = 64 THEN
  146.                 Adaptor$ = "Multi-Colour Graphics Array"
  147.              ELSE
  148.                 Adaptor$ = "Video Graphics Array"
  149.              END IF
  150.         CASE 7 TO 10
  151.              Adaptor$ = "Enhanced Graphics Adaptor"
  152.         CASE 3
  153.              Adaptor$ = "Hercules Graphics Card"
  154.         CASE 2
  155.              Adaptor$ = "Colour Graphics Adaptor"
  156.         CASE ELSE
  157.              Adaptor$ = "Monochrome Display Adaptor"
  158.     END SELECT
  159.  
  160.     Mouse% = MouseInit%                         ' See if a mouse is available
  161.  
  162.     DIM Menu$(0 TO 12)                          ' Dimension array for menus
  163.     HotKeys% = FALSE                            ' Disable hotkeys in menus
  164.     Printr% = 1                                 ' Use the first parallel port
  165.     RootName$ = "DEMON"                         ' Used for help topic files
  166.     DOS$ = "DOS " + DosVersion$                 ' Check current DOS version
  167.     Lc$ = "abcdefghijklmnopqrstuvwxyz"          ' Lowercase letters
  168.     Uc$ = UCASE$(Lc$)                           ' Uppercase letters
  169.     Nu$ = "0123456789"                          ' Numerals
  170.     VFln$ = "\._^$~!#%&-@`({})'"                ' Legal pathname characters
  171.  
  172.     DY$ = MID$(DATE$, 4, 2): DY% = VAL(DY$)     ' What day is this?
  173.     MO$ = LEFT$(DATE$, 2): MO% = VAL(MO$)       ' What month is this?
  174.     YR$ = RIGHT$(DATE$, 2): YR% = VAL(YR$)      ' What year is this?
  175.     Now$ = DY$ + "/" + MO$ + "/" + YR$          ' Format it as DD/MM/YY
  176.  
  177.     ToDay$ = LongDate$(DY%, MO%, YR%)           ' Translate date into words
  178.  
  179. '┌────────────────────────────────────────────────────────────────────────┐
  180. '│      Main Menu.                                                        │
  181. '└────────────────────────────────────────────────────────────────────────┘
  182. '
  183.     ReSeed TIMER
  184. D001:
  185.     Head$ = "ASSEMBLY-LANGUAGE TOOLBOX for VisualBASIC DOS"
  186.     LOCATE , , 0: Frame Head$, 1: Bar% = 1
  187. D002:
  188.     IF MaxRes% < 1 THEN
  189.        Menu$(0) = "WSFKME X"
  190.     ELSE
  191.        Menu$(0) = "WSFKMEGX"
  192.     END IF
  193.     Menu$(1) = "&Windows": Menu$(2) = "&Screen"
  194.     Menu$(3) = "&Files": Menu$(4) = "&Keyboard"
  195.     Menu$(5) = "&Memory": Menu$(6) = "&Examples"
  196.     Menu$(7) = "&Graphics": Menu$(8) = "E&xit"
  197.     Abort% = FALSE: HotKey% = FALSE
  198.     IF Nxt% THEN
  199.        IF Bar% = 1 THEN Bar% = 8
  200.        IF Bar% = 9 THEN Bar% = 2
  201.     END IF
  202.     BarMenu 3, BarColour%, 8, Menu$(), Bar%, Nxt%, 1, RootName$, Mouse%, HotKeys%
  203.     SELECT CASE Bar%
  204.         CASE 1
  205.              GOTO D100
  206.         CASE 2
  207.              GOTO D200
  208.         CASE 3
  209.              GOTO D300
  210.         CASE 4
  211.              GOTO D400
  212.         CASE 5
  213.              GOTO D500
  214.         CASE 6
  215.              GOTO D600
  216.         CASE 7
  217.              GOTO D700
  218.         CASE 8
  219.              GOTO D800
  220.         CASE 9
  221.              HelpMate 0, "", 0, ""
  222.         CASE ELSE
  223.              Ok% = Verify%(1, 9, "Exit program, are you sure", 0, Mouse%)
  224.              IF Ok% THEN GOTO Egress
  225.     END SELECT
  226. GOTO D002
  227.  
  228. '┌────────────────────────────────────────────────────────────────────────┐
  229. '│      Popup Window Demonstration.                                       │
  230. '└────────────────────────────────────────────────────────────────────────┘
  231. '
  232. D100:
  233.     A$ = STRING$(1680, "░"): FastPrint 4, 1, A$, 30
  234.     FastPrint 25, 1, SPACE$(80), StatColour%: A$ = ""
  235.     FastPrint 25, 2, Adaptor$, StatColour%
  236.     FastPrint 25, 71, DOS$, StatColour%
  237.     FOR M% = 1 TO 3
  238.         Area% = 0: O% = 0: B% = 1
  239.         DO
  240.             H% = Rand%(5, 10): W% = Rand%(14, 40)
  241.             Area% = Area% + (H% + 1) * (W% + 1)
  242.             IF Area% > 7200 THEN EXIT DO
  243.             K% = Rand%(4, 24 - H%): J% = Rand%(1, 79 - W%)
  244.             R% = Rand%(1, 4): S% = Rand%(1, 4)
  245.             Attrib% = Attribute%(15, B%)
  246.             PopUp K%, J%, H%, W%, Attrib%, R%, S%, -1
  247.             FastPrint K%, J% + ((W% \ 2) - 5), "[ WINDOW ]", Attrib%
  248.             O% = O% + 1: B% = B% + 1: IF B% > 6 THEN B% = 1
  249.          LOOP UNTIL O% = 30
  250.          IF (M% = 3) THEN SLEEP 3 ELSE SLEEP 1
  251.          FOR I% = O% TO 1 STEP -1
  252.              ShutUp -1
  253.          NEXT I%
  254.     NEXT M%
  255.     PopUp 4, 15, 10, 30, 52, 4, 1, -1: PopUp 3, 36, 13, 40, 47, 3, 1, -1
  256.     PopUp 9, 10, 13, 40, 31, 2, 1, -1: PopUp 12, 42, 11, 36, 67, 1, 1, -1
  257.     PopUp 2, 31, 5, 20, 78, 2, 1, -1: FastPrint 4, 34, "Presenting ...", 78
  258.     SLEEP 3: KeyFlush: Attrib% = Attribute%(0, 7)
  259.     PopUp 8, 20, 7, 40, Attrib%, 2, 1, -1
  260.     FastPrint 8, 31, "[ QUICK  WINDOWS ]", Attrib%
  261.     FastPrint 10, 29, "Windowing Routines for", Attrib%
  262.     FastPrint 11, 29, "Microsoft Visual BASIC", Attrib%
  263.     SLEEP 3: KeyFlush: Attrib% = Attribute%(0, 3)
  264.     PopUp 17, 55, 7, 24, Attrib%, 1, 3, -1
  265.     FastPrint 19, 66, "By", Attrib%
  266.     FastPrint 20, 59, "Christy Gemmell", Attrib%
  267.     FastPrint 21, 65, "and", Attrib%
  268.     FastPrint 22, 58, "Singular Software", Attrib%
  269.     SLEEP 3: KeyFlush: Attrib% = Attribute%(14, 1)
  270.     PopUp 13, 2, 10, 23, Attrib%, 2, 4, 0
  271.     FastPrint 15, 4, "A Library of screen", Attrib%
  272.     FastPrint 16, 4, "handling procedures", Attrib%
  273.     FastPrint 17, 4, "and functions which", Attrib%
  274.     FastPrint 18, 4, "can be incorporated", Attrib%
  275.     FastPrint 19, 4, "in your VisualBASIC", Attrib%
  276.     FastPrint 20, 4, "programs for MSDOS.", Attrib%
  277.     SLEEP 4: KeyFlush: Attrib% = Attribute%(15, 1)
  278.     PopUp 16, 27, 5, 26, Attrib%, 2, 1, 0
  279.     FastPrint 18, 30, "HOLD ONTO YOUR HATS", Attrib%
  280.     SLEEP 2: KeyFlush: FOR I% = 1 TO 9: ShutUp -1: NEXT
  281.     Attrib% = 112: PopUp 9, 16, 8, 50, Attrib%, 2, 2, 0: RESTORE Blurb
  282.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, Attrib%: NEXT
  283.     SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, Attrib%
  284.     FOR I% = 12 TO 13: READ Me$: FastPrint I%, 19, Me$, Attrib%: NEXT
  285.     SLEEP 5: KeyFlush: IF Colour% THEN Attrib% = Attribute%(1, 2)
  286.     PopUp 5, 5, 6, 35, Attrib%, 0, 1, -1
  287.     SLEEP 3: ShutUp -1: Scroll 1, 10, 17, 15, 64, 0, 112
  288.     FOR I% = 12 TO 13: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  289.     SLEEP 6: KeyFlush: IF Colour% THEN Attrib% = Attribute%(15, 6)
  290.     PopUp 6, 5, 8, 35, Attrib%, 0, 2, -1
  291.     FastPrint 6, 15, "[  No  Frame  ]", Attrib%
  292.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(11, 1)
  293.     PopUp 7, 8, 8, 35, Attrib%, 1, 2, -1
  294.     FastPrint 7, 17, "[ Frame Style 1 ]", Attrib%
  295.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(0, 2)
  296.     PopUp 8, 11, 8, 35, Attrib%, 2, 2, -1
  297.     FastPrint 8, 20, "[ Frame Style 2 ]", Attrib%
  298.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(0, 3)
  299.     PopUp 9, 14, 8, 35, Attrib%, 3, 2, -1
  300.     FastPrint 9, 23, "[ Frame Style 3 ]", Attrib%
  301.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(14, 4)
  302.     PopUp 10, 17, 8, 35, Attrib%, 4, 2, -1
  303.     FastPrint 10, 26, "[ Frame Style 4 ]", Attrib%
  304.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(12, 5)
  305.     PopUp 11, 20, 8, 35, Attrib%, 5, 2, -1
  306.     FastPrint 11, 29, "[ Frame Style 5 ]", Attrib%
  307.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(13, 6)
  308.     PopUp 12, 23, 8, 35, Attrib%, 6, 2, -1
  309.     FastPrint 12, 32, "[ Frame Style 6 ]", Attrib%
  310.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(15, 2)
  311.     PopUp 13, 26, 8, 35, Attrib%, 7, 2, -1
  312.     FastPrint 13, 35, "[ Frame Style 7 ]", Attrib%
  313.     SLEEP 1: KeyFlush: IF Colour% THEN Attrib% = Attribute%(1, 3)
  314.     PopUp 14, 29, 8, 35, Attrib%, 8, 2, -1
  315.     FastPrint 14, 39, "[ Frame Style 8 ]", Attrib%
  316.     SLEEP 4: KeyFlush: FOR I% = 1 TO 9: ShutUp -1: NEXT
  317.     Scroll 1, 10, 17, 15, 64, 0, 112
  318.     FOR I% = 11 TO 13: READ Me$: FastPrint I%, 20, Me$, 112: NEXT
  319.     SLEEP 6: KeyFlush
  320.     FOR I% = 1 TO 15
  321.         Label$ = "[ Colour:" + STR$(I%) + " ]"
  322.         J% = Rand%(1, 51): K% = Rand%(1, 13)
  323.         Attrib% = Attribute%(I%, 0)
  324.         PopUp K% + 1, J% + 1, 7, 24, Attrib%, 4, 0, 0
  325.         FastPrint K% + 1, J% + 6, Label$, Attrib%
  326.         SLEEP 1: KeyFlush
  327.     NEXT I%
  328.     Attrib% = Attribute%(31, B%)
  329.     PopUp 7, 20, 7, 24, Attrib%, 4, 2, 0
  330.     FastPrint 7, 25, "[ Colour: 31 ]", Attrib%
  331.     SLEEP 4: KeyFlush: FOR I% = 1 TO 16: ShutUp 0: NEXT
  332.     Scroll 1, 10, 17, 15, 64, 0, 112
  333.     FOR I% = 12 TO 13: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  334.     SLEEP 6: KeyFlush: Attrib% = Attribute%(15, 1)
  335.     PopUp 2, 2, 11, 30, Attrib%, 7, 0, 0
  336.     SLEEP 3: KeyFlush: ShutUp 0: Scroll 1, 10, 17, 15, 64, 0, 112
  337.     FOR I% = 12 TO 13: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  338.     SLEEP 6: KeyFlush: Attrib% = Attribute%(14, 5)
  339.     PopUp 5, 5, 10, 30, Attrib%, 2, 1, 0
  340.     FastPrint 9, 14, "Left Shadow", Attrib%
  341.     SLEEP 2: KeyFlush: Attrib% = Attribute%(0, 2)
  342.     PopUp 5, 45, 10, 30, Attrib%, 2, 2, 0
  343.     FastPrint 9, 54, "Right Shadow", Attrib%
  344.     SLEEP 2: KeyFlush: ShutUp 0: ShutUp 0
  345.     Scroll 1, 10, 17, 15, 64, 0, 112
  346.     FastPrint 12, 31, "Windows can be zoomed", 112
  347.     FastPrint 13, 33, "onto the screen.", 112
  348.     SLEEP 3: KeyFlush: Attrib% = Attribute%(0, 2)
  349.     PopUp 2, 2, 15, 60, Attrib%, 2, 0, -1
  350.     SLEEP 2: KeyFlush: Attrib% = Attribute%(0, 3)
  351.     PopUp 13, 10, 10, 60, Attrib%, 3, 0, -1
  352.     SLEEP 2: KeyFlush: Attrib% = Attribute%(14, 5)
  353.     PopUp 7, 33, 10, 45, Attrib%, 1, 0, -1
  354.     SLEEP 2: KeyFlush: Attrib% = Attribute%(15, 4)
  355.     IF NOT Colour% THEN Attrib% = 112
  356.     PopUp 7, 10, 12, 63, Attrib%, 2, 1, -1
  357.     FastPrint 12, 32, "<<< W O W >>>", Attrib%
  358.     SLEEP 3: KeyFlush: FOR I% = 1 TO 4: ShutUp -1: NEXT
  359.     Scroll 1, 10, 17, 15, 64, 0, 112
  360.     FOR I% = 10 TO 14: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  361.     SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  362.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  363.     SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  364.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  365.     SLEEP 6: KeyFlush: Attrib% = Attribute%(0, 2)
  366.     PopUp 3, 5, 15, 45, Attrib%, 4, 1, -1
  367.     FastPrint 9, 14, "This is the first level ...", Attrib%
  368.     SLEEP 2: KeyFlush: Attrib% = Attribute%(15, 4)
  369.     PopUp 6, 29, 17, 50, Attrib%, 4, 1, -1
  370.     FastPrint 12, 40, "This is the second level ...", Attrib%
  371.     SLEEP 2: KeyFlush: Attrib% = Attribute%(0, 3)
  372.     PopUp 9, 22, 15, 35, Attrib%, 4, 1, -1
  373.     FastPrint 16, 26, "This is the third level ...", Attrib%
  374.     SLEEP 2: KeyFlush: FastPrint 16, 26, "Now to go back ...         ", Attrib%
  375.     SLEEP 1: ShutUp -1: SLEEP 1: ShutUp -1: SLEEP 1: ShutUp -1: SLEEP 2
  376.     Scroll 1, 10, 17, 15, 64, 0, 112: KeyFlush
  377.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  378.     Ok% = Verify%(1, 9, "Are you enjoying this program", 0, Mouse%)
  379.     Scroll 1, 10, 17, 15, 64, 0, 112
  380.     IF Ok% THEN
  381.        FastPrint 11, 28, "You sound very positive!", 112
  382.     ELSE
  383.        FastPrint 11, 28, "You sound very negative!", 112
  384.     END IF
  385.     SLEEP 2: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  386.     FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  387.     SLEEP 3: KeyFlush: SL% = StatusLine%("Want to carry on?")
  388.     IF SL% = 78 OR SL% = 110 OR SL% = 27 THEN
  389.        ShutUp -1
  390.     ELSE
  391.        A$ = STRING$(44, SL%)
  392.        FOR I% = 10 TO 15: FastPrint I%, 19, A$, 112: NEXT
  393.        SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  394.        FOR I% = 10 TO 15: READ Me$: FastPrint I%, 19, Me$, 112: NEXT
  395.        SLEEP 6: KeyFlush: Scroll 1, 10, 17, 15, 64, 0, 112
  396.        Ready% = PrinTest%(Printr%)
  397.        IF Ready% THEN
  398.           FastPrint 11, 30, "PRINTER CONTROL MENU", 112
  399.           FastPrint 13, 24, "The Toolbox contains versions for", 112
  400.           FastPrint 14, 27, "two other popular printers.", 112
  401.           FastPrint 25, 2, "Press <ESC> to Abort       ", StatColour%
  402.           PrintSet 4, 51, 0, Printr%, Mouse%
  403.           FastPrint 25, 1, SPACE$(80), StatColour%
  404.           FastPrint 25, 2, Adaptor$, StatColour%
  405.           FastPrint 25, 71, DOS$, StatColour%
  406.           SLEEP 5: KeyFlush
  407.        END IF
  408.        ShutUp -1
  409.        PopUp 4, 15, 10, 30, 52, 4, 1, -1
  410.        PopUp 3, 36, 13, 40, 47, 3, 1, -1
  411.        PopUp 9, 10, 13, 40, 78, 2, 1, -1
  412.        PopUp 12, 42, 11, 36, 67, 1, 1, -1
  413.        PopUp 9, 16, 8, 52, 112, 2, 1, -1
  414.        FastPrint 11, 20, "The video routines in the Toolbox Library", 112
  415.        FastPrint 12, 20, "give you all you need to create powerful", 112
  416.        FastPrint 13, 20, "and professional screen displays in your", 112
  417.        FastPrint 14, 20, "Visual BASIC programs.", 112: SLEEP 9: KeyFlush
  418.        FOR I% = 1 TO 5: ShutUp -1: SLEEP 1: KeyFlush: NEXT
  419.        IF NOT Ready% THEN
  420.           PopUp 10, 18, 5, 44, 96, 1, 2, 0
  421.           Me$ = "Pity you didn't have a printer connected"
  422.           FastPrint 12, 20, Me$, 96: SLEEP 5: KeyFlush: ShutUp 0
  423.        END IF
  424.     END IF
  425. GOTO D001
  426.  
  427. '┌────────────────────────────────────────────────────────────────────────┐
  428. '│      Screen control functions.                                         │
  429. '└────────────────────────────────────────────────────────────────────────┘
  430. '
  431. D200:
  432.     Menu$(0) = "F#SC#B"
  433.     Menu$(1) = "&Fast screen printing"
  434.     Menu$(3) = "&Selective scrolling"
  435.     Menu$(4) = "&Clear to the end"
  436.     Menu$(6) = "&Background colours"
  437.     VerMenu 4, 3, BarColour%, 1, 6, "SCREEN CONTROL", Menu$(), Choice%, Nxt%, Bar%, 1, RootName$, Mouse%, HotKeys%
  438.     IF Nxt% THEN GOTO D002
  439.     SELECT CASE Choice%
  440.         CASE 1
  441.              GOTO D210
  442.         CASE 3
  443.              GOTO D220
  444.         CASE 4
  445.              GOTO D230
  446.         CASE 6
  447.              GOTO D240
  448.         CASE ELSE
  449.     END SELECT
  450. GOTO D002
  451.  
  452. '   Screen print demonstration
  453. '
  454. D210:
  455.     A$ = STRING$(1680, "«"): B$ = STRING$(1680, "»")
  456.     FOR I% = 1 TO 255
  457.         FastPrint 4, 1, A$, I%: FastPrint 4, 1, B$, I%
  458.         IF INKEY$ = CHR$(27) THEN EXIT FOR
  459.     NEXT I%
  460.     IF I% = 256 THEN
  461.        A$ = "": B$ = "": C$ = STRING$(1680, "░"): Attrib% = 30
  462.        FastPrint 4, 1, C$, Attrib%: C$ = ""
  463.        IF Colour% THEN Attrib% = 48 ELSE Attrib% = 112
  464.        PopUp 12, 21, 7, 40, Attrib%, 1, 4, -1
  465.        Panel 12, 21, 7, 40, 5, Attrib%
  466.        FastPrint 15, 33, "<<< W O W >>>", Attrib%
  467.        SLEEP 5: KeyFlush: ShutUp -1
  468.     END IF
  469. GOTO D200
  470.  
  471. '   Selective scrolling demonstration
  472. '
  473. D220:
  474.     Panel 4, 1, 21, 80, 1, TextColour%
  475.     IF Colour% THEN BackGround% = 7 ELSE BackGround% = 0
  476.     Clr% = 1: IF Mouse% THEN MouseShow
  477.     DO
  478.        Scroll 0, 4, 21, 7, 60, 1, Attribute%(0, Clr%)
  479.        Scroll 2, 9, 6, 19, 20, 1, Attribute%(0, Clr%)
  480.        Scroll 3, 9, 61, 19, 75, 1, Attribute%(0, Clr%)
  481.        Scroll 1, 21, 21, 24, 60, 1, Attribute%(0, Clr%)
  482.        COLOR Clr%, BackGround%
  483.        LOCATE 19, 25: PRINT "SCROLLING UP";
  484.        Scroll 0, 9, 23, 19, 38, 1, Attribute%(Clr%, BackGround%)
  485.        LOCATE 9, 43: PRINT "SCROLLING DOWN";
  486.        Scroll 1, 9, 41, 19, 58, 1, Attribute%(Clr%, BackGround%)
  487.        Pause 1: Clr% = Clr% + 1
  488.        IF Clr% = BackGround% THEN Clr% = Clr% + 1
  489.        IF Clr% > 7 THEN Clr% = 1
  490.        IF Mouse% THEN
  491.           MouseNow LeftButton%, RightButton%, xMouse%, yMouse%
  492.           IF LeftButton% THEN
  493.              IF yMouse% > 15 AND yMouse% < 24 THEN
  494.                 Z$ = CHR$(32): EXIT DO
  495.              END IF
  496.           END IF
  497.        END IF
  498.        Z$ = INKEY$
  499.     LOOP UNTIL Z$ = CHR$(27)
  500.     IF Mouse% THEN
  501.        CALL MouseHide: IF Z$ <> CHR$(27) THEN GOTO D002
  502.     END IF
  503. GOTO D200
  504.  
  505. '   Clear to end of line or screen
  506. '
  507. D230:
  508.     Panel 4, 1, 24, 80, 1, TextColour%
  509.     IF Colour% THEN Attrib% = 15 ELSE Attrib% = 112
  510.     FastPrint 22, 30, "Press a key to do it", TextColour%
  511.     FastPrint 10, 3, "Clear end of line >", TextColour%
  512.     LOCATE 10, 22, 1: R$ = INPUT$(1): ClearEnd 0, Attrib%
  513.     FastPrint 15, 3, "Clear end of screen >", TextColour%
  514.     LOCATE 15, 24, 1: R$ = INPUT$(1): ClearEnd 1, Attrib%
  515.     LOCATE , , 0: Frame Head$, 0
  516. GOTO D200
  517.  
  518. D240:
  519.     FastPrint 25, 1, SPACE$(80), StatColour%
  520.     FastPrint 25, 3, "Press any key, <Esc> to abort", StatColour%
  521.     RANDOMIZE TIMER: IF Mouse% THEN MouseShow
  522.     DO
  523.        Row% = Rand%(5, 20): Col% = Rand%(2, 62): Rows% = Rand%(1, 16)
  524.        IF Row% + Rows% > 23 THEN Rows% = 24 - Row%
  525.        Cols% = Rand%(1, 60): IF Col% + Cols% > 78 THEN Cols% = 79 - Col%
  526.        Attrib% = Rand%(0, 255): BackFill Row%, Col%, Rows%, Cols%, Attrib%
  527.        DO
  528.           IF Mouse% THEN
  529.              MouseNow LeftButton%, RightButton%, xMouse%, yMouse%
  530.              IF LeftButton% THEN
  531.                 IF yMouse% > 15 AND yMouse% < 24 THEN
  532.                    Z$ = CHR$(27)
  533.                    EXIT DO
  534.                 ELSE
  535.                    Z$ = CHR$(32)
  536.                    EXIT DO
  537.                 END IF
  538.              END IF
  539.           END IF
  540.           Z$ = INKEY$
  541.        LOOP UNTIL Z$ <> ""
  542.     LOOP UNTIL Z$ = CHR$(27)
  543.     Frame Head$, 0: IF Mouse% THEN MouseHide:
  544.     IF Z$ <> CHR$(27) THEN GOTO D002
  545. GOTO D200
  546.  
  547. '┌────────────────────────────────────────────────────────────────────────┐
  548. '│      File Functions.                                                   │
  549. '└────────────────────────────────────────────────────────────────────────┘
  550. '
  551. D300:
  552.     Menu$(0) = "WH#S"
  553.     Menu$(1) = "&Where's that file?"
  554.     Menu$(2) = "&How big is that file?"
  555.     Menu$(4) = "&Sort that file"
  556.     Abort% = FALSE
  557.     VerMenu 4, 9, BarColour%, 1, 4, "FILE FUNCTIONS", Menu$(), Choice%, Nxt%, Bar%, 1, RootName$, Mouse%, HotKeys%
  558.     IF Nxt% THEN GOTO D002
  559.     SELECT CASE Choice%
  560.         CASE 1
  561.              GOTO D310
  562.         CASE 2
  563.              GOTO D320
  564.         CASE 4
  565.              GOTO D330
  566.         CASE ELSE
  567.     END SELECT
  568. GOTO D002
  569.  
  570. '   File Finder
  571. '
  572. D310:
  573.     Panel 4, 1, 21, 80, 1, TextColour%
  574.     RESTORE Finder
  575.     FOR I% = 1 TO 13
  576.         READ Me$: FastPrint 5 + I%, 14, Me$, TextColour%
  577.     NEXT I%
  578.     Scroll 1, 19, 2, 21, 79, 0, TextColour%
  579.     PopUp 19, 19, 4, 44, 96, 4, 4, -1
  580.     Panel 19, 19, 4, 44, 5, 96: HotKey% = FALSE
  581.     FastPrint 20, 28, "Enter name of file to find", 96
  582.     LOCATE 21, 21: Legal$ = Uc$ + Lc$ + Nu$ + VFln$ + ":*?"
  583.     PathName$ = RevInput$(40, 0, "", Legal$, 1, "REVINPUT", 0, HotKey%)
  584.     ShutUp -1
  585.     IF HotKey% THEN
  586.        Abort% = TRUE
  587.     ELSE
  588.        PathName$ = RTRIM$(LTRIM$(PathName$))
  589.        Found$ = FindFile$(PathName$, 0, Mouse%)
  590.        IF Found$ <> "" THEN
  591.           Found$ = LTRIM$(RTRIM$(Found$))
  592.           OT% = 40 - (LEN(Found$) \ 2)
  593.           FastPrint 20, OT%, Found$, TextColour%
  594.        END IF
  595.     END IF
  596. GOTO D300
  597.  
  598. D320:
  599.     Panel 4, 1, 21, 80, 1, TextColour%
  600.     RESTORE Size
  601.     FOR I% = 1 TO 12
  602.         READ Me$: FastPrint 5 + I%, 8, Me$, TextColour%
  603.     NEXT I%
  604.     Scroll 1, 18, 3, 23, 78, 0, TextColour%: HotKey% = FALSE
  605.     LOCATE 20, 20: Legal$ = Uc$ + Lc$ + Nu$ + VFln$ + "*?"
  606.     PathName$ = RevInput$(64, 40, "", Legal$, 1, "REVINPUT", 0, HotKey%)
  607.     IF HotKey% THEN
  608.        Abort% = TRUE
  609.     ELSE
  610.        PathName$ = LTRIM$(RTRIM$(PathName$))
  611.        IF PathName$ = "" THEN PathName$ = "*.*"
  612.        IF IsDir%(PathName$) THEN PathName$ = PathName$ + "\*.*"
  613.        FastPrint 20, 8, SPACE$(64), TextColour%
  614.        FastPrint 20, 8, PathName$, TextColour%
  615.        Bytes& = FileSize&(PathName$)
  616.        IF Bytes& > 0 THEN
  617.           Me$ = "Size = " + LTRIM$(RTRIM$(STR$(Bytes&))) + " bytes"
  618.           FastPrint 22, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  619.        ELSE
  620.           MisTake 9, "No match found!", 0, Mouse%
  621.        END IF
  622.     END IF
  623. GOTO D300
  624.  
  625. '   File sorter.
  626. '
  627. D330:
  628.     Panel 4, 1, 21, 80, 1, TextColour%
  629.     RESTORE Sorts
  630.     FOR I% = 1 TO 10
  631.         READ Me$: FastPrint 4 + I%, 8, Me$, TextColour%
  632.     NEXT I%
  633.     IF FileSize&("SAMPLE.DAT") < 1 THEN
  634.        MisTake 9, "Can't find SAMPLE data file to sort!", 0, Mouse%
  635.     ELSE
  636.        IF Colour% THEN Attrib% = 32 ELSE Attrib% = 112
  637.        PopUp 16, 3, 8, 74, Attrib%, 1, 4, -1
  638.        Panel 16, 3, 8, 74, 5, Attrib%
  639.        FastPrint 16, 36, " SAMPLE.DAT ", Attrib%
  640.        OPEN "SAMPLE.DAT" FOR INPUT AS #1
  641.        FOR I% = 1 TO 6
  642.            LINE INPUT #1, A$: OL% = LEN(A$)
  643.            Me$ = LEFT$(A$, OL% - 2)
  644.            FastPrint 16 + I%, 40 - (OL% \ 2) + 1, Me$, Attrib%
  645.        NEXT I%
  646.        CLOSE 1: SL% = StatusLine%("To begin sorting ...")
  647.        SortFile "SAMPLE.DAT", 1, 10, OL% + 2, Done%
  648.        IF Done% THEN
  649.           OPEN "SAMPLE.DAT" FOR INPUT AS #1
  650.           FOR I% = 1 TO 6
  651.               LINE INPUT #1, A$: OL% = LEN(A$)
  652.               Me$ = LEFT$(A$, OL% - 2)
  653.               FastPrint 16 + I%, 40 - (OL% \ 2) + 1, Me$, Attrib%
  654.           NEXT I%
  655.           CLOSE 1
  656.           SL% = StatusLine%("File successfully sorted"): ShutUp -1
  657.        ELSE
  658.           ShutUp -1
  659.           FastPrint 21, 30, "Unable to sort file", TextColour%
  660.        END IF
  661.     END IF
  662. GOTO D300
  663.  
  664. '┌────────────────────────────────────────────────────────────────────────┐
  665. '│      Keyboard functions and procedures.                                │
  666. '└────────────────────────────────────────────────────────────────────────┘
  667. '
  668. D400:
  669.     Menu$(0) = "AKT#M"
  670.     Menu$(1) = "&ASCII and scan codes"
  671.     Menu$(2) = "&Keyboard shift flags"
  672.     Menu$(3) = "&Typeahead buffer"
  673.     Menu$(5) = "&Mouse position and status"
  674.     VerMenu 4, 16, BarColour%, 1, 5, "KEYBOARD AND MOUSE", Menu$(), Choice%, Nxt%, Bar%, 1, RootName$, Mouse%, HotKeys%
  675.     IF Nxt% THEN GOTO D002
  676.     SELECT CASE Choice%
  677.         CASE 1
  678.              GOTO D410
  679.         CASE 2
  680.              GOTO D420
  681.         CASE 3
  682.              GOTO D430
  683.         CASE 5
  684.              GOTO D440
  685.         CASE ELSE
  686.     END SELECT
  687. GOTO D002
  688.  
  689. '   Indexes to the font table in ROM-BIOS, then translates the pixel
  690. '   values of the character specified by a keypress, into a large-
  691. '   scale representation of that character.
  692. '
  693. D410:
  694.     Panel 4, 1, 21, 80, 1, TextColour%
  695.     Fore$ = STRING$(2, "█"): Back$ = STRING$(2, "░")
  696.     FastPrint 6, 31, "┌────────────────┐", TextColour%
  697.     FOR Row% = 7 TO 14
  698.         FastPrint Row%, 31, "│" + STRING$(16, "░") + "│", TextColour%
  699.     NEXT Row%
  700.     FastPrint 15, 31, "└────────────────┘", TextColour%
  701.     FastPrint 25, 1, SPACE$(80), StatColour%
  702.     FastPrint 25, 3, "Press any key, or <Esc> to abort", StatColour%
  703.     LOCATE 21, 40, 1: Abort% = FALSE: CALL KeyFlush
  704.     DO
  705.         Character% = KeyIn%: IF Character% = 27 THEN EXIT DO
  706.         FastPrint 21, 40, " ", TextColour%
  707.         FastPrint 16, 10, SPACE$(60), TextColour%
  708.         SELECT CASE Character%
  709.             CASE 0 TO 127
  710.                  FOR Row% = 1 TO 8
  711.                      Pixel% = FarPeek%(&HF000, &HFA6D + (Character% * 8) + Row%)
  712.                      IF Pixel% = 0 THEN
  713.                         FastPrint Row% + 6, 32, STRING$(16, "░"), TextColour%
  714.                      ELSE
  715.                         Col% = 32
  716.                         FOR Column% = 7 TO 0 STEP -1
  717.                             IF Pixel% < 2 ^ Column% THEN
  718.                                FastPrint Row% + 6, Col%, Back$, TextColour%
  719.                             ELSE
  720.                                FastPrint Row% + 6, Col%, Fore$, TextColour%
  721.                                Pixel% = Pixel% - 2 ^ Column%
  722.                             END IF
  723.                             Col% = Col% + 2
  724.                         NEXT Column%
  725.                      END IF
  726.                  NEXT Row%
  727.             CASE ELSE
  728.                  IF Character% < 0 THEN
  729.                     Me$ = SPACE$(16)
  730.                  ELSE
  731.                     Me$ = STRING$(16, Character%)
  732.                  END IF
  733.                  FOR Row% = 1 TO 8
  734.                      FastPrint Row% + 6, 32, Me$, TextColour%
  735.                  NEXT Row%
  736.         END SELECT
  737.         IF Character% < 0 THEN
  738.            Me$ = "Scan Code " + LTRIM$(RTRIM$(STR$(ABS(Character%))))
  739.         ELSE
  740.            Me$ = "ASCII Code " + LTRIM$(RTRIM$(STR$(Character%)))
  741.         END IF
  742.         FastPrint 16, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  743.     LOOP WHILE 1
  744.     LOCATE , , 0: Frame Head$, 0
  745. GOTO D400
  746.  
  747. '   Keyboard shift flags.
  748. '
  749. D420:
  750.     Panel 4, 1, 21, 80, 1, TextColour%
  751.     ShiftFlags% = KeyFlags%: Flag$ = STRING$(16, "0")
  752.     FOR I% = 15 TO 0 STEP -1
  753.         IF BitTest%(ShiftFlags%, I%) THEN
  754.            MID$(Flag$, 16 - I%, 1) = "1"
  755.         END IF
  756.     NEXT I%
  757.     FastPrint 5, 40, "Keyboard Status Word at 0040:0017", TextColour%
  758.     FastPrint 7, 40, "Bit settings (1 = set)", TextColour%
  759.     FastPrint 5, 3, " F E D C B A 9 8 7 6 5 4 3 2 1 0", TextColour%
  760.     FastPrint 6, 3, "┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐", TextColour%
  761.     FastPrint 7, 3, "│", TextColour%: Col% = 4
  762.     FOR I% = 1 TO 16
  763.         FastPrint 7, Col%, MID$(Flag$, I%, 1) + "│", TextColour%
  764.         Col% = Col% + 2
  765.     NEXT I%
  766.     FastPrint 8, 3, "└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘", TextColour%
  767.     FastPrint 9, 3, " │ │ │ │ │ │ │ │ │ │ │ │ │ │ └─┴─", TextColour%
  768.     FastPrint 10, 3, " │ │ │ │ │ │ │ │ │ │ │ │ │ └─────", TextColour%
  769.     FastPrint 11, 3, " │ │ │ │ │ │ │ │ │ │ │ │ └───────", TextColour%
  770.     FastPrint 12, 3, " │ │ │ │ │ │ │ │ │ │ │ └─────────", TextColour%
  771.     FastPrint 13, 3, " │ │ │ │ │ │ │ │ │ │ └───────────", TextColour%
  772.     FastPrint 14, 3, " │ │ │ │ │ │ │ │ │ └─────────────", TextColour%
  773.     FastPrint 15, 3, " │ │ │ │ │ │ │ │ └───────────────", TextColour%
  774.     FastPrint 16, 3, " │ │ │ │ │ │ │ └─────────────────", TextColour%
  775.     FastPrint 17, 3, " │ │ │ │ │ │ └───────────────────", TextColour%
  776.     FastPrint 18, 3, " │ │ │ │ │ └─────────────────────", TextColour%
  777.     FastPrint 19, 3, " │ │ │ │ └───────────────────────", TextColour%
  778.     FastPrint 20, 3, " │ │ │ └─────────────────────────", TextColour%
  779.     FastPrint 21, 3, " │ │ └───────────────────────────", TextColour%
  780.     FastPrint 22, 3, " │ └─────────────────────────────", TextColour%
  781.     FastPrint 23, 3, " └───────────────────────────────", TextColour%
  782.     FastPrint 25, 1, SPACE$(80), StatColour%
  783.     FastPrint 25, 3, "Press <Esc> to abort", StatColour%
  784.     RESTORE Shift
  785.     FOR I% = 1 TO 15
  786.         READ Me$: FastPrint I% + 8, 40, Me$, TextColour%
  787.     NEXT I%
  788.     IF Mouse% THEN MouseShow
  789.     DO
  790.         ShiftFlags% = KeyFlags%
  791.         FOR I% = 15 TO 0 STEP -1
  792.             IF BitTest%(ShiftFlags%, I%) THEN
  793.                MID$(Flag$, 16 - I%, 1) = "1"
  794.             ELSE
  795.                MID$(Flag$, 16 - I%, 1) = "0"
  796.             END IF
  797.         NEXT I%
  798.         Col% = 4
  799.         FOR I% = 1 TO 16
  800.             FastPrint 7, Col%, MID$(Flag$, I%, 1) + "│", TextColour%
  801.             Col% = Col% + 2
  802.         NEXT I%
  803.         CL% = CapsLock%(2)
  804.         IF CL% THEN
  805.            FastPrint 25, 65, "CAPS", 14
  806.         ELSE
  807.            FastPrint 25, 65, "    ", StatColour%
  808.         END IF
  809.         NL% = NumLock%(2)
  810.         IF NL% THEN
  811.            FastPrint 25, 70, "NUM", 14
  812.         ELSE
  813.            FastPrint 25, 70, "   ", StatColour%
  814.         END IF
  815.         SL% = ScrLock%(2)
  816.         IF SL% THEN
  817.            FastPrint 25, 74, "SCRL", 14
  818.         ELSE
  819.            FastPrint 25, 74, "    ", StatColour%
  820.         END IF
  821.         IF Mouse% THEN
  822.            MouseNow LeftButton%, RightButton%, xMouse%, yMouse%
  823.            IF LeftButton% THEN
  824.               IF yMouse% > 15 AND yMouse% < 24 THEN
  825.                  Z$ = CHR$(32): EXIT DO
  826.               END IF
  827.            END IF
  828.         END IF
  829.         Z$ = INKEY$
  830.     LOOP UNTIL Z$ = CHR$(27)
  831.     Frame Head$, 0
  832.     IF Mouse% THEN
  833.        CALL MouseHide: IF Z$ <> CHR$(27) THEN GOTO D002
  834.     END IF
  835. GOTO D400
  836.  
  837. '   Keyboard typeahead buffer.
  838. '
  839. D430:
  840.     COLOR 7, 0: Panel 4, 1, 21, 80, 1, 14
  841.     RESTORE KeyBuff: READ Items%
  842.     FOR I% = 1 TO Items%
  843.         READ Row%, Col%, Me$: LOCATE Row%, Col%, 0: PRINT Me$;
  844.     NEXT I%
  845.     LOCATE 11, 68: COLOR 11
  846.     Start% = &H400 + FarPeek%(&H40, &H80)
  847.     Finish% = &H400 + FarPeek%(&H40, &H82)
  848.     PRINT RIGHT$("0000" + HEX$(Start%), 4); " ";
  849.     PRINT RIGHT$("0000" + HEX$(Finish%), 4);
  850.     DO
  851.         Hd% = &H400 + FarPeek%(&H40, &H1A)
  852.         Tl% = &H400 + FarPeek%(&H40, &H1C)
  853.         LOCATE 11, 4: COLOR 11
  854.         PRINT RIGHT$("0000" + HEX$(Hd%), 4); " ";
  855.         PRINT RIGHT$("0000" + HEX$(Tl%), 4);
  856.         COLOR 13: LOCATE 9, 17: PRINT SPACE$(48);
  857.         LOCATE 9, 17 + ((Hd% - &H41E) \ 2) * 3: PRINT CHR$(25);
  858.         COLOR 12: LOCATE 13, 17: PRINT SPACE$(48);
  859.         LOCATE 13, 17 + ((Tl% - &H41E) \ 2) * 3: PRINT CHR$(24);
  860.         FOR I% = 0 TO 15
  861.             C% = FarPeek%(&H40, &H1E + (I% * 2))
  862.             S% = FarPeek%(&H40, &H1E + (I% * 2) + 1)
  863.             IF C% < 32 THEN Ky$ = "  " ELSE Ky$ = CHR$(C%) + " "
  864.             LOCATE 11, 17 + (I% * 3): COLOR 14: PRINT Ky$;
  865.             LOCATE 14, 17 + (I% * 3): COLOR 9
  866.             PRINT RIGHT$("0" + HEX$(C%), 2);
  867.             LOCATE 15, 17 + (I% * 3): COLOR 10
  868.             PRINT RIGHT$("0" + HEX$(S%), 2);
  869.         NEXT I%
  870.         IF Hd% >= Tl% THEN
  871.            Kys% = 16 - ((Hd% - Tl%) \ 2)
  872.         ELSE
  873.            Kys% = (Tl% - Hd%) \ 2
  874.         END IF
  875.         LOCATE 14, 76: IF Kys% = 16 THEN Kys% = 0
  876.         PRINT RIGHT$(" " + LTRIM$(RTRIM$(STR$(Kys%))), 2);
  877.         IF Kys% = 15 THEN
  878.            LOCATE 15, 67: COLOR 28: PRINT "BUFFER FULL";
  879.            SLEEP 2: KeyFlush: LOCATE , 67: PRINT SPACE$(11);
  880.         END IF
  881.     LOOP UNTIL FarPeek%(&H40, (Tl% - &H400) - 2) = 27
  882.     COLOR 7, 0: LOCATE 20, 1, 0
  883.     Dummy$ = INPUT$(Kys%)
  884. GOTO D400
  885.  
  886. '   Report mouse cursor position and status.
  887. '
  888. D440:
  889.     IF Mouse% THEN
  890.        Panel 4, 1, 21, 80, 1, TextColour%
  891.        CALL MouseShow
  892.        DO
  893.           MouseNow LeftButton%, RightButton%, xMouse%, yMouse%
  894.           Me$ = "x=" + LTRIM$(RTRIM$(STR$(xMouse%))) + "  "
  895.           FastPrint 12, 31, Me$, TextColour%
  896.           Me$ = "y=" + LTRIM$(RTRIM$(STR$(yMouse%))) + "  "
  897.           FastPrint 12, 41, Me$, TextColour%
  898.           IF LeftButton% THEN
  899.              IF yMouse% > 15 AND yMouse% < 24 THEN
  900.                 EXIT DO
  901.              ELSE
  902.                 Me$ = "Left button pressed"
  903.              END IF
  904.           ELSE
  905.              Me$ = "                   "
  906.           END IF
  907.           FastPrint 14, 31, Me$, TextColour%
  908.           IF RightButton% THEN
  909.              Me$ = "Right button pressed"
  910.           ELSE
  911.              Me$ = "                    "
  912.           END IF
  913.           FastPrint 15, 31, Me$, TextColour%: Z$ = INKEY$
  914.        LOOP UNTIL Z$ = CHR$(27)
  915.        CALL MouseHide
  916.        IF Z$ <> CHR$(27) THEN GOTO D002
  917.     ELSE
  918.        MisTake 9, "Mouse driver not installed", 0, Mouse%
  919.     END IF
  920. GOTO D400
  921.  
  922. '┌────────────────────────────────────────────────────────────────────────┐
  923. '│      Memory-related functions and procedures.                          │
  924. '└────────────────────────────────────────────────────────────────────────┘
  925. '
  926. D500:
  927.     IF EmsPresent% THEN Menu$(0) = "F#E" ELSE Menu$(0) = "F# "
  928.     Menu$(1) = "Operating system &Flags"
  929.     Menu$(3) = "&Expanded memory services"
  930.     Abort% = FALSE
  931.     VerMenu 4, 26, BarColour%, 1, 3, "MEMORY", Menu$(), Choice%, Nxt%, Bar%, 1, RootName$, Mouse%, HotKeys%
  932.     IF Nxt% THEN GOTO D002
  933.     SELECT CASE Choice%
  934.         CASE 1
  935.              GOTO D510
  936.         CASE 3
  937.              GOTO D520
  938.         CASE ELSE
  939.     END SELECT
  940. GOTO D002
  941.  
  942. '┌────────────────────────────────────────────────────────────────────────┐
  943. '│      System Flags.                                                     │
  944. '└────────────────────────────────────────────────────────────────────────┘
  945. '
  946. D510:
  947.     DIM CoOrd%(16, 2): Context% = 1: Topic$ = "FLAGS"
  948.     Panel 4, 1, 21, 80, 1, TextColour%: RESTORE Flags
  949.     FOR I% = 6 TO 21
  950.         READ Me$: FastPrint I%, 6, Me$, TextColour%
  951.     NEXT I%
  952.     Panel 7, 51, 16, 27, 0, 0
  953.     Panel 6, 50, 16, 27, 7, 48
  954.     FastPrint 7, 53, "CURRENT FLAG SETTINGS", 48
  955.     FastPrint 8, 50, "╟" + STRING$(25, "─") + "╢", 48
  956.     FastPrint 8, 50, "╟", 55
  957.     FOR I% = 10 TO 17
  958.         READ Me$: FastPrint I%, 52, Me$, 48
  959.     NEXT I%
  960.     FOR I% = 1 TO 16
  961.         READ CoOrd%(I%, 1), CoOrd%(I%, 2): F% = GetFlag%(I%)
  962.         F$ = LTRIM$(RTRIM$(STR$(F%))): F$ = RIGHT$("   " + F$, 3)
  963.         FastPrint CoOrd%(I%, 1), CoOrd%(I%, 2), F$, 48
  964.     NEXT I%
  965.     FastPrint 19, 52, "Enter Flag Number:", 48
  966.     FastPrint 25, 3, SPACE$(78), StatColour%
  967.     FastPrint 25, 3, "Press <ESC> to Abort", StatColour%
  968.     DO
  969.        LOCATE 19, 73: HotKey% = FALSE
  970.        Number$ = RevInput$(2, 0, Number$, Nu$, 1, "REVINPUT", 0, HotKey%)
  971.        IF HotKey% THEN
  972.           Abort% = TRUE
  973.        ELSE
  974.           Number% = VAL(Number$)
  975.           IF Number% < 1 OR Number% > 16 THEN
  976.              BEEP
  977.           ELSE
  978.              Number$ = LTRIM$(RTRIM$(STR$(Number%)))
  979.              Number$ = RIGHT$("  " + Number$, 2)
  980.              FastPrint 19, 73, Number$, 48
  981.              Setting% = GetFlag%(Number%)
  982.              Setting$ = RIGHT$("   " + LTRIM$(RTRIM$(STR$(Setting%))), 3)
  983.              LOCATE CoOrd%(Number%, 1), CoOrd%(Number%, 2)
  984.              Setting$ = RevInput$(3, 0, Setting$, Nu$, 1, "REVINPUT", 0, HotKey%)
  985.              IF HotKey% THEN
  986.                 Abort% = TRUE
  987.              ELSE
  988.                 Setting% = VAL(Setting$)
  989.                 IF Setting% < 0 OR Setting% > 255 THEN
  990.                    BEEP
  991.                 ELSE
  992.                    SetFlag Number%, Setting%
  993.                 END IF
  994.                 Setting% = GetFlag%(Number%)
  995.                 Setting$ = RIGHT$("   " + LTRIM$(RTRIM$(STR$(Setting%))), 3)
  996.                 FastPrint CoOrd%(Number%, 1), CoOrd%(Number%, 2), Setting$, 48
  997.              END IF
  998.           END IF
  999.        END IF
  1000.     LOOP UNTIL Abort%
  1001.     ERASE CoOrd%: Frame Head$, 0
  1002. GOTO D500
  1003.  
  1004. '┌────────────────────────────────────────────────────────────────────────┐
  1005. '│      Expanded Memory services.                                         │
  1006. '└────────────────────────────────────────────────────────────────────────┘
  1007. '
  1008. D520:
  1009.     Panel 4, 1, 21, 80, 1, TextColour%: Handle% = FALSE
  1010.     FastPrint 6, 23, "┌─────────────────────────────────┐", TextColour%
  1011.     FastPrint 7, 23, "│  EXPANDED MEMORY DEMONSTRATION  │", TextColour%
  1012.     FastPrint 8, 23, "└─────────────────────────────────┘", TextColour%
  1013.     Version% = EmsVersion%: PageFrame% = EmsFrame%
  1014.     EmsTotal% = EmsPages%(0): EmsFree% = EmsPages%(1)
  1015.     LIM$ = LTRIM$(RTRIM$(STR$(Version%))): L% = LEN(LIM$)
  1016.     IF L% > 1 THEN LIM$ = LEFT$(LIM$, L% - 1) + "." + RIGHT$(LIM$, 1)
  1017.     Me$ = "You have" + STR$(EmsTotal% * 16) + " KiloBytes of LIM " + LIM$ + " Expanded Memory installed."
  1018.     FastPrint 10, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1019.     Me$ = "The Page Frame segment is at address " + HEX$(PageFrame%) + " Hex,"
  1020.     FastPrint 11, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1021.     Me$ = "and there are" + STR$(EmsFree%) + " pages (" + LTRIM$(RTRIM$(STR$(EmsFree% * 16))) + "KB) free."
  1022.     FastPrint 12, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1023.     IF EmsFree% < 4 THEN
  1024.        Me$ = "Sorry, that's not enough for this demonstration."
  1025.        FastPrint 15, 40 - (LEN(Me$) \ 2), Me$, TextColour%: GOTO D525
  1026.     END IF
  1027.     SLEEP 1: KeyFlush: Me$ = "Requesting four pages for this demonstration,"
  1028.     FastPrint 14, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1029.     EmsRequest 4, Handle%: IF Handle% = 0 THEN GOTO D529
  1030.     Pages% = EmsOwned%(Handle%): IF Pages% < 4 THEN GOTO D529
  1031.     Me$ = "they have been assigned to Handle" + STR$(Handle%) + "."
  1032.     FastPrint 15, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1033.     Me$ = "Saving this screen to page 1": SLEEP 1: KeyFlush
  1034.     FastPrint 17, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1035.     IF Colour% THEN Segment% = &HB800 ELSE Segment% = &HB000
  1036.     SLEEP 1: KeyFlush: Me$ = "Drawing and saving three other screens ...."
  1037.     FastPrint 17, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1038.     EmsPut Segment%, 0, 4000, 1, Handle%, Done%
  1039.     IF NOT Done% THEN GOTO D529
  1040.     SLEEP 1: KeyFlush: FastPrint 25, 1, SPACE$(80), StatColour%
  1041.     Page% = 2: Row% = 11: Col% = 35
  1042.     RESTORE Numbers
  1043.     DO
  1044.         READ Columns%, BackGround%: IF NOT Colour% THEN BackGround% = 0
  1045.         Attr% = Attribute%(15, BackGround%)
  1046.         BackFill 4, 1, 21, 80, Attr%
  1047.         Scroll 1, 9, 2, 23, 79, 0, Attr%
  1048.         FastPrint 10, 36, "P A G E", Attr%
  1049.         FOR I% = 1 TO Columns%
  1050.             READ Item$: IF Item$ = "F" THEN Item$ = "12345678"
  1051.             FOR J% = 1 TO LEN(Item$)
  1052.                 Rows% = VAL(MID$(Item$, J%, 1))
  1053.                 FastPrint Row% + Rows%, Col% + I%, CHR$(219), Attr%
  1054.             NEXT J%
  1055.         NEXT I%
  1056.         EmsPut Segment%, 0, 4000, Page%, Handle%, Done%
  1057.         Page% = Page% + 1: IF NOT Done% THEN EXIT DO
  1058.         SLEEP 1: KeyFlush
  1059.     LOOP UNTIL Page% > 4
  1060.     IF NOT Done% THEN GOTO D529
  1061.     EmsGet Segment%, 0, 4000, 1, Handle%, Done%
  1062.     IF NOT Done% THEN GOTO D529
  1063.     Me$ = "Now I'll let YOU bring 'em back again ...."
  1064.     FastPrint 19, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1065.     FastPrint 22, 24, "Press a key when you're ready >", TextColour%
  1066.     LOCATE 22, 56, 1: Page% = 4: IF KeyIn% = 27 THEN GOTO D525
  1067.     DO
  1068.        EmsGet Segment%, 0, 4000, Page%, Handle%, Done%
  1069.        IF NOT Done% THEN EXIT DO
  1070.        FastPrint 25, 63, "Press a key >", StatColour%
  1071.        LOCATE 25, 77: KeyPress% = KeyIn%
  1072.        Page% = Page% - 1
  1073.     LOOP WHILE Page% > 1
  1074.     IF Done% THEN EmsGet Segment%, 0, 4000, 1, Handle%, Done%
  1075.     LOCATE , , 0: IF NOT Done% THEN GOTO D529
  1076.     Me$ = "The demonstration was completely successful, which proves that"
  1077.     FastPrint 17, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1078.     Me$ = "your Expanded Memory is in good working order."
  1079.     FastPrint 18, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1080. D525:
  1081.     IF Handle% THEN
  1082.        SLEEP 1: KeyFlush: EmsRelease Handle%
  1083.        Me$ = "We released all pages assigned to handle" + STR$(Handle%) + " before finishing,"
  1084.        FastPrint 20, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1085.        Me$ = "otherwise no other program would have been able to use them."
  1086.        FastPrint 21, 40 - (LEN(Me$) \ 2), Me$, TextColour%
  1087.     END IF
  1088.     SLEEP 2: KeyFlush
  1089. GOTO D500
  1090.  
  1091. D529:
  1092.     Me$ = "An EMM error" + STR$(EmsError%) + " has just occurred ..."
  1093.     MisTake 12, Me$, 0, Mouse%
  1094. GOTO D525
  1095.  
  1096. '┌────────────────────────────────────────────────────────────────────────┐
  1097. '│      Miscellaneous functions and procedures.                           │
  1098. '└────────────────────────────────────────────────────────────────────────┘
  1099. '
  1100. D600:
  1101.     Menu$(0) = "DHEFP"
  1102.     Menu$(1) = "&Date entry and validation"
  1103.     Menu$(2) = "&Hardware equipment list"
  1104.     Menu$(3) = "&Encryption of text"
  1105.     Menu$(4) = "&Fast string sorting"
  1106.     Menu$(5) = "&Percentage box"
  1107.     Abort% = FALSE
  1108.     VerMenu 4, 34, BarColour%, 1, 5, "EXAMPLES", Menu$(), Choice%, Nxt%, Bar%, 1, RootName$, Mouse%, HotKeys%
  1109.     IF Nxt% THEN GOTO D002
  1110.     SELECT CASE Choice%
  1111.         CASE 1
  1112.              GOTO D610
  1113.         CASE 2
  1114.              GOTO D620
  1115.         CASE 3
  1116.              GOTO D630
  1117.         CASE 4
  1118.              GOTO D640
  1119.         CASE 5
  1120.              GOTO D650
  1121.         CASE ELSE
  1122.     END SELECT
  1123. GOTO D002
  1124.  
  1125. '┌────────────────────────────────────────────────────────────────────────┐
  1126. '│      Long Date Routine.                                                │
  1127. '└────────────────────────────────────────────────────────────────────────┘
  1128. '
  1129. D610:
  1130.     IF Colour% THEN Attrib% = 48 ELSE Attrib% = 112
  1131.     HotKey% = FALSE: IF ToDay$ = "" THEN ToDay$ = SPACE$(20)
  1132.     Context% = 1: Topic$ = "LONGDATE": WW% = LEN(ToDay$)
  1133.     WT% = 41 - (WW% \ 2): PopUp 8, 24, 9, 34, Attrib%, 1, 4, -1
  1134.     Panel 8, 24, 9, 34, 5, Attrib%
  1135.     FastPrint 9, 33, "Today's date is:", Attrib%
  1136.     FastPrint 10, WT%, ToDay$, Attrib%
  1137.     Ok% = Verify%(1, 12, "Is this correct", 0, Mouse%)
  1138.     IF NOT Ok% THEN
  1139.        FastPrint 12, 32, "Enter correct date", Attrib%
  1140.        Panel 13, 36, 3, 10, 9, Attrib%
  1141.        Temp$ = "": LOCATE 14, 37
  1142.        Temp$ = DateInput$(Temp$, 1, "DATINPUT", HotKey%)
  1143.        IF HotKey% THEN
  1144.           Abort% = TRUE
  1145.        ELSE
  1146.           Now$ = Temp$: MO% = VAL(MID$(Temp$, 4, 2))
  1147.           DY% = VAL(LEFT$(Temp$, 2)): YR% = VAL(RIGHT$(Temp$, 2))
  1148.           ToDay$ = LongDate$(DY%, MO%, YR%): OL% = LEN(ToDay$)
  1149.           IF OL% > 0 THEN
  1150.              FastPrint 25, 41, SPACE$(40), StatColour%
  1151.              FastPrint 25, 79 - OL%, ToDay$, StatColour%
  1152.           END IF
  1153.        END IF
  1154.     END IF
  1155.     ShutUp -1
  1156. GOTO D600
  1157.  
  1158. '┌────────────────────────────────────────────────────────────────────────┐
  1159. '│      Equipment List.                                                   │
  1160. '└────────────────────────────────────────────────────────────────────────┘
  1161. '
  1162. D620:
  1163.     Panel 4, 1, 21, 80, 1, TextColour%
  1164.     Cols$ = "80": Video$ = "colour": REDIM Model(0 TO 8) AS STRING
  1165.     RESTORE HWare: FOR I% = 0 TO 8: READ Model(I%): NEXT
  1166.     Equipment% = PeekWord&(&H40, &H10): Flag$ = STRING$(16, "0")
  1167.     Computer% = FarPeek%(&HF000, &HFFFE)
  1168.     Computer% = Computer% - &HF8: IF Computer% < 0 THEN Computer% = 0
  1169.     FastPrint 8, 38, "IBM " + Model(Computer%) + " or compatible", TextColour%
  1170.     Chip% = Cpu%: CoPro% = MathsChip%
  1171.     SELECT CASE Chip%
  1172.         CASE IS < 0
  1173.              Me$ = " an Intel 80C" + LTRIM$(RTRIM$(STR$(ABS(Chip%))))
  1174.         CASE 20, 30
  1175.              Me$ = " a NEC V" + LTRIM$(RTRIM$(STR$(Chip%)))
  1176.         CASE 88 TO 486
  1177.              Me$ = " an Intel 80" + LTRIM$(RTRIM$(STR$(Chip%)))
  1178.         CASE ELSE
  1179.              Me$ = " an unknown"
  1180.     END SELECT
  1181.     Me$ = "with" + Me$ + " microprocessor"
  1182.     FastPrint 9, 38, Me$, TextColour%
  1183.     FOR I% = 15 TO 0 STEP -1
  1184.         IF BitTest%(Equipment%, I%) THEN
  1185.            MID$(Flag$, 16 - I%, 1) = "1"
  1186.         END IF
  1187.     NEXT I%
  1188.     FastPrint 8, 3, " F E D C B A 9 8 7 6 5 4 3 2 1 0", TextColour%
  1189.     FastPrint 9, 3, "┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐", TextColour%
  1190.     FastPrint 10, 3, "│", TextColour%: Col% = 4
  1191.     FOR I% = 1 TO 16
  1192.         FastPrint 10, Col%, MID$(Flag$, I%, 1) + "│", TextColour%
  1193.         Col% = Col% + 2
  1194.     NEXT I%
  1195.     FastPrint 10, 38, "ROM BIOS Equipment Flag at 0040:0010", TextColour%
  1196.     FastPrint 11, 3, "└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘", TextColour%
  1197.     FastPrint 12, 3, " │ │   │ │ │ │   │ │ │ │ │ │ │ │", TextColour%
  1198.     FastPrint 13, 3, " │ │   │ │ │ │   │ │ │ │ │ │ │ └─", TextColour%
  1199.     FastPrint 14, 3, " │ │   │ │ │ │   │ │ │ │ │ │ └───", TextColour%
  1200.     FastPrint 15, 3, " │ │   │ │ │ │   │ │ │ │ └─┴─────", TextColour%
  1201.     FastPrint 16, 3, " │ │   │ │ │ │   │ │ └─┴─────────", TextColour%
  1202.     FastPrint 17, 3, " │ │   │ │ │ │   └─┴─────────────", TextColour%
  1203.     FastPrint 18, 3, " │ │   │ └─┴─┴───────────────────", TextColour%
  1204.     FastPrint 19, 3, " │ │   └─────────────────────────", TextColour%
  1205.     FastPrint 20, 3, " └─┴─────────────────────────────", TextColour%
  1206.     FastPrint 13, 38, "Floppy drives installed?", TextColour%
  1207.     IF MID$(Flag$, 16, 1) = "1" THEN Me$ = "Yes" ELSE Me$ = "No"
  1208.     FastPrint 13, 68, Me$, TextColour%
  1209.     FastPrint 14, 38, "Maths coprocessor installed?", TextColour%
  1210.     IF MID$(Flag$, 15, 1) = "1" THEN Me$ = "Yes" ELSE Me$ = "No"
  1211.     IF CoPro% > 0 THEN Me$ = "80" + LTRIM$(RTRIM$(STR$(CoPro%)))
  1212.     FastPrint 14, 68, Me$, TextColour%
  1213.     FastPrint 15, 38, "Original PC motherboard RAM", TextColour%
  1214.     IF Computer% = 1 THEN
  1215.        Ram% = (BinDec&(MID$(Flag$, 13, 2)) + 1) * 16
  1216.        Me$ = RIGHT$("  " + LTRIM$(RTRIM$(STR$(Ram%))), 2) + "KB"
  1217.     ELSE
  1218.        Me$ = "n/a"
  1219.     END IF
  1220.     FastPrint 15, 68, Me$, TextColour%
  1221.     FastPrint 16, 38, "Initial Video mode", TextColour%
  1222.     Mode% = BinDec&(MID$(Flag$, 11, 2))
  1223.     IF Mode% = 1 THEN Cols$ = "40"
  1224.     IF Mode% = 7 THEN Video$ = "mono"
  1225.     FastPrint 16, 58, Cols$ + " column " + Video$, TextColour%
  1226.     FastPrint 17, 38, "Number of floppy drives", TextColour%
  1227.     Mode% = BinDec&(MID$(Flag$, 9, 2)) + 1
  1228.     Me$ = LTRIM$(RTRIM$(STR$(Mode%))): FastPrint 17, 68, Me$, TextColour%
  1229.     FastPrint 18, 38, "Number of serial ports", TextColour%
  1230.     Mode% = BinDec&(MID$(Flag$, 5, 3)) + 1
  1231.     Me$ = LTRIM$(RTRIM$(STR$(Mode%))): FastPrint 18, 68, Me$, TextColour%
  1232.     FastPrint 19, 38, "Games adaptor installed?", TextColour%
  1233.     IF MID$(Flag$, 3, 1) = "1" THEN Me$ = "Yes" ELSE Me$ = "No"
  1234.     FastPrint 19, 68, Me$, TextColour%
  1235.     FastPrint 20, 38, "Number of parallel printers", TextColour%
  1236.     Mode% = BinDec&(LEFT$(Flag$, 2))
  1237.     Me$ = LTRIM$(RTRIM$(STR$(Mode%))): FastPrint 20, 68, Me$, TextColour%
  1238.     FastPrint 25, 1, SPACE$(80), StatColour%
  1239.     FastPrint 25, 3, "Press a key to continue", StatColour%
  1240.     IF Mouse% THEN MouseShow
  1241.     DO
  1242.        IF Mouse% THEN
  1243.           MouseNow LeftButton%, RightButton%, xMouse%, yMouse%
  1244.           IF LeftButton% THEN
  1245.              IF yMouse% > 15 AND yMouse% < 24 THEN
  1246.                 Z$ = "": EXIT DO
  1247.              END IF
  1248.           END IF
  1249.        END IF
  1250.        Z$ = INKEY$
  1251.     LOOP WHILE Z$ = ""
  1252.     Frame Head$, 0: ERASE Model
  1253.     IF Mouse% THEN
  1254.        CALL MouseHide: IF Z$ = "" THEN GOTO D002
  1255.     END IF
  1256. GOTO D600
  1257.  
  1258. '   Text Encryption.
  1259. '
  1260. D630:
  1261.     Panel 4, 1, 21, 80, 1, TextColour%
  1262.     Done% = FALSE: Abort% = FALSE: HotKey% = FALSE
  1263.     Text$ = "": Code$ = ""
  1264.     RESTORE Crypt
  1265.     FOR I% = 1 TO 5
  1266.         READ Me$: FastPrint 6 + I%, 11, Me$, TextColour%
  1267.     NEXT I%
  1268.     IF Colour% THEN Attrib% = 32 ELSE Attrib% = 112
  1269.     DO WHILE Text$ = ""
  1270.        PopUp 17, 19, 4, 44, Attrib%, 2, 2, -1
  1271.        FastPrint 18, 27, "Enter string to be encrypted", Attrib%
  1272.        LOCATE 19, 21
  1273.        Text$ = RevInput$(40, 0, "", "", 1, "REVINPUT", -1, HotKey%)
  1274.        ShutUp -1: IF HotKey% THEN Abort% = TRUE: EXIT DO
  1275.        Text$ = LTRIM$(RTRIM$(Text$))
  1276.        IF Text$ = "" THEN
  1277.           MisTake 9, "You can't encrypt an empty string!", 0, Mouse%
  1278.        END IF
  1279.     LOOP
  1280.     IF NOT Abort% THEN
  1281.        IF Colour% THEN Attrib% = 78 ELSE Attrib% = 112
  1282.        DO WHILE Code$ = ""
  1283.           PopUp 17, 19, 4, 44, Attrib%, 2, 2, -1
  1284.           FastPrint 18, 25, "Enter string to encrypt it with", Attrib%
  1285.           LOCATE 19, 21
  1286.           Code$ = RevInput$(40, 0, "", "", 1, "REVINPUT", -1, HotKey%)
  1287.           ShutUp -1: IF HotKey% THEN Abort% = TRUE: EXIT DO
  1288.           Code$ = LTRIM$(RTRIM$(Code$))
  1289.           IF Code$ = "" THEN
  1290.              MisTake 12, "An empty string is no use!", 0, Mouse%
  1291.           END IF
  1292.        LOOP
  1293.        IF NOT Abort% THEN
  1294.           Cipher Text$, Code$: Me$ = "Encrypted string >  " + Text$
  1295.           FastPrint 14, 11, Me$, TextColour%
  1296.           IF Colour% THEN Attrib% = 48 ELSE Attrib% = 112
  1297.           DO
  1298.              DO
  1299.                 PopUp 19, 19, 4, 44, Attrib%, 2, 2, -1
  1300.                 FastPrint 20, 27, "Enter key string once again", Attrib%
  1301.                 LOCATE 21, 21
  1302.                 DeCode$ = RevInput$(40, 0, "", "", 1, "REVINPUT", -1, HotKey%)
  1303.                 ShutUp -1: IF HotKey% THEN Abort% = TRUE: EXIT DO
  1304.                 DeCode$ = LTRIM$(RTRIM$(DeCode$))
  1305.                 IF DeCode$ = "" THEN
  1306.                    MisTake 12, "An empty string is no use!", 0, Mouse%
  1307.                 END IF
  1308.              LOOP WHILE DeCode$ = ""
  1309.              IF Abort% THEN
  1310.                 Done% = TRUE
  1311.              ELSE
  1312.                 Me$ = Text$: Cipher Me$, DeCode$
  1313.                 Me$ = "Decrypted string >  " + Me$
  1314.                 FastPrint 16, 11, Me$, TextColour%
  1315.                 IF Code$ = DeCode$ THEN
  1316.                    FastPrint 19, 33, "That's the one!", TextColour%
  1317.                    Done% = TRUE
  1318.                 ELSE
  1319.                    Me$ = "Whoops, that's not right"
  1320.                    IF MisMatch% THEN
  1321.                       Me$ = Me$ + " either"
  1322.                    END IF
  1323.                    MisTake 9, Me$ + "!", 0, Mouse%
  1324.                    MisMatch% = TRUE
  1325.                 END IF
  1326.              END IF
  1327.           LOOP UNTIL Done%
  1328.        END IF
  1329.     END IF
  1330. GOTO D600
  1331.  
  1332. '   Demonstrate string array sorting and scan routines.
  1333. '
  1334. D640:
  1335.     Room% = TRUE: Me$ = "Not enough memory for sort array"
  1336.     ON ERROR GOTO D645
  1337.     REDIM Array(1 TO 1000) AS STRING
  1338.     ON ERROR GOTO Trap
  1339.     IF NOT Room% THEN GOTO D600
  1340.     RESTORE Strings: IF Colour% THEN COLOR 0, 7
  1341.     Panel 4, 1, 21, 80, 1, TextColour%
  1342.     FOR Row% = 6 TO 7
  1343.         READ Me$: LOCATE Row%, 3: PRINT Me$
  1344.     NEXT Row%
  1345.     FOR I% = 1 TO 1000
  1346.         FOR J% = 1 TO Rand%(5, 11)
  1347.             Array(I%) = Array(I%) + CHR$(Rand%(0, 25) + 65)
  1348.         NEXT J%
  1349.     NEXT I%
  1350.     LOCATE 7, 50: PRINT "done!"
  1351.     LOCATE 9, 3: PRINT "Unsorted array"
  1352.     FOR I% = 1 TO 3
  1353.         Me$ = "Element " + RIGHT$("    " + LTRIM$(RTRIM$(STR$(I%))), 4)
  1354.         LOCATE 10 + I%, 3: PRINT Me$; " "; Array(I%)
  1355.     NEXT I%
  1356.     LOCATE 14, 3: PRINT "  .": Row% = 15
  1357.     FOR I% = 998 TO 1000
  1358.         Me$ = "Element " + RIGHT$("    " + LTRIM$(RTRIM$(STR$(I%))), 4)
  1359.         LOCATE Row%, 3: PRINT Me$; " "; Array(I%): Row% = Row% + 1
  1360.     NEXT I%
  1361.     PopUp 19, 13, 5, 53, BarColour%, 4, 4, 0
  1362.     READ Me$: FastPrint 21, 15, Me$, BarColour%
  1363.     LOCATE 21, 62: Legal$ = "AaDd"
  1364.     A$ = UCASE$(RevInput$(1, 0, "A", Legal$, 1, "REVINPUT", 0, HotKey%))
  1365.     ShutUp 0: IF Colour% THEN COLOR 0, 7
  1366.     IF HotKey% THEN Abort% = TRUE: GOTO D642
  1367.     IF A$ = "D" THEN
  1368.        Direction% = 1: A$ = "descending"
  1369.     ELSE
  1370.        Direction% = 0: A$ = "ascending"
  1371.     END IF
  1372.     LOCATE 19, 3: PRINT "Sorting the array into "; A$; " order ....";
  1373.     First% = LBOUND(Array): Last% = UBOUND(Array)
  1374.     X! = TIMER
  1375.     StringSort Direction%, 1000, VARPTR(Array(First%))
  1376.     Y! = TIMER
  1377.     PRINT " done!": LOCATE 9, 41: PRINT "Sorted array"
  1378.     FOR I% = 1 TO 3
  1379.         Me$ = "Element " + RIGHT$("    " + LTRIM$(RTRIM$(STR$(I%))), 4)
  1380.         LOCATE 10 + I%, 41: PRINT Me$; " "; Array(I%)
  1381.     NEXT I%
  1382.     LOCATE 14, 41: PRINT "  .": Row% = 15
  1383.     FOR I% = 998 TO 1000
  1384.         Me$ = "Element " + RIGHT$("    " + LTRIM$(RTRIM$(STR$(I%))), 4)
  1385.         LOCATE Row%, 41: PRINT Me$; " "; Array(I%): Row% = Row% + 1
  1386.     NEXT I%
  1387.     LOCATE 20, 3: PRINT USING "The sort took ###.### seconds"; Y! - X!
  1388.     Ok% = Verify%(1, 16, "Search array", 0, Mouse%): IF NOT Ok% THEN GOTO D642
  1389. D641:
  1390.     PopUp 12, 17, 8, 46, BarColour%, 3, 4, -1: HotKey% = 0
  1391.     FastPrint 14, 20, "Enter a string to insert into the array", BarColour%
  1392.     LOCATE 15, 30: A$ = RevInput$(20, 0, "", "", 1, "REVINPUT", 0, HotKey%)
  1393.     IF HotKey% THEN Abort% = TRUE: ShutUp -1: GOTO D642
  1394.     A$ = LTRIM$(RTRIM$(A$))
  1395.     Me$ = "Enter element to insert it into (1-" + LTRIM$(RTRIM$(STR$(Last%))) + ") "
  1396.     FastPrint 16, 40 - (LEN(Me$) \ 2), Me$, BarColour%
  1397.     LOCATE 17, 38: Temp$ = RevInput$(4, 0, "", Nu$, 1, "REVINPUT", 0, HotKey%)
  1398.     ShutUp -1: IF Colour% THEN COLOR 0, 7
  1399.     IF HotKey% THEN
  1400.        Abort% = TRUE: GOTO D642
  1401.     ELSE
  1402.        S% = VAL(Temp$)
  1403.        IF S% < First% OR S% > Last% THEN
  1404.           MisTake 9, "OUT OF RANGE!", 0, Mouse%
  1405.           GOTO D641
  1406.        ELSE
  1407.           Array(S%) = A$
  1408.           IF S% < 4 THEN
  1409.              LOCATE 10 + S%, 54: PRINT SPACE$(12);
  1410.              LOCATE 10 + S%, 54: PRINT A$;
  1411.           ELSEIF S% > 997 THEN
  1412.              LOCATE S% - 983, 54: PRINT SPACE$(12);
  1413.              LOCATE S% - 983, 54: PRINT A$;
  1414.           END IF
  1415.        END IF
  1416.     END IF
  1417.     LOCATE 21, 3: PRINT "Scanning array for " + A$ + " .... ";
  1418.     X! = TIMER
  1419.     Match% = StringScan%(A$, 1000, First%, VARPTR(Array$(First%)))
  1420.     Y! = TIMER
  1421.     PRINT "found it at element"; Match%
  1422.     LOCATE 22, 3: PRINT USING "The search took ###.### seconds"; Y! - X!
  1423. D642:
  1424.     ERASE Array: IF Colour% THEN COLOR 7, 0
  1425. GOTO D002
  1426.  
  1427. D645:
  1428.     MisTake 9, Me$, 0, Mouse%
  1429.     Room% = FALSE
  1430. RESUME NEXT
  1431.  
  1432. '   Display a popup window with a percentage bar measuring the progress
  1433. '   of a function or procedure.
  1434. '
  1435. D650:
  1436.     PerCentBox 1, "Passing the time away", 0, 0
  1437.     StartTime& = TIMER
  1438.     DO
  1439.         ThisTime& = TIMER - StartTime&
  1440.         Percentage% = (ThisTime& / 30) * 100
  1441.         PerCentBox 2, "", 0, Percentage%
  1442.         IF INKEY$ = CHR$(27) THEN EXIT DO
  1443.     LOOP UNTIL ThisTime& > 30
  1444.     PerCentBox 3, "", 0, 0
  1445. GOTO D600
  1446.  
  1447. '┌────────────────────────────────────────────────────────────────────────┐
  1448. '│      Graphics examples.                                                │
  1449. '└────────────────────────────────────────────────────────────────────────┘
  1450. '
  1451. D700:
  1452.     VideoMode Colour%, MaxRes%, VideoRam%
  1453.     IF MaxRes% > 8 THEN
  1454.        Menu$(0) = "CP#SR"
  1455.     ELSEIF MaxRes% AND MaxRes% <> 3 THEN
  1456.        Menu$(0) = "C #  "
  1457.     ELSE
  1458.        Menu$(0) = "  #  "
  1459.     END IF
  1460.     Menu$(1) = "Graphics &characters"
  1461.     Menu$(2) = "Video &panning"
  1462.     Menu$(4) = "&Save screen to file"
  1463.     Menu$(5) = "&Restore screen"
  1464.     VerMenu 4, 47, BarColour%, 1, 5, "GRAPHICS", Menu$(), Choice%, Nxt%, Bar%, 1, RootName$, Mouse%, HotKeys%
  1465.     IF Nxt% THEN GOTO D002
  1466.     SELECT CASE Choice%
  1467.         CASE 1
  1468.              GOTO D710
  1469.         CASE 2
  1470.              GOTO D720
  1471.         CASE 4, 5
  1472.              GOTO D730
  1473.         CASE ELSE
  1474.     END SELECT
  1475. GOTO D002
  1476.  
  1477. '┌────────────────────────────────────────────────────────────────────────┐
  1478. '│      Graphics characters.                                              │
  1479. '└────────────────────────────────────────────────────────────────────────┘
  1480. '
  1481. D710:
  1482.     SELECT CASE MaxRes%
  1483.         CASE 2                                  ' Colour Graphics Adaptor
  1484.              Mode = 1
  1485.              SCREEN 1                           ' 320 x 200   4-colour
  1486.         CASE 9                                  ' Enhanced Graphics Adaptor
  1487.              Mode = 2
  1488.              SCREEN 9                           ' 640 x 350  16-colour
  1489.              WINDOW SCREEN (0, 0)-(319, 199)
  1490.         CASE 13
  1491.              IF VideoRam% > 64 THEN
  1492.                 Mode = 3                        ' Video Graphics Array
  1493.                 SCREEN 12                       ' 640 X 480  16-colour
  1494.                 WINDOW SCREEN (0, 0)-(319, 199)
  1495.              ELSE
  1496.                 Mode = 4                        ' Multicolour Graphics Array
  1497.                 SCREEN 13                       ' 320 x 200 256-colour
  1498.              END IF
  1499.         CASE ELSE
  1500.              MisTake 9, "Incompatible Video Card!", 0, Mouse%
  1501.              GOTO D002
  1502.     END SELECT
  1503.  
  1504.     REDIM Hue(1 TO 4) AS INTEGER
  1505.     PLAY "mft240o3l8d#fgl8b-p8l8gl2b-"          ' Hoop-la!
  1506.     RESTORE Title
  1507.     PLAY "mbl8t255o3bo4cdo3bo4co3abgaf#t120gbt200dp8"
  1508.     FOR I% = 1 TO 4: READ Hue(I%): NEXT
  1509.     READ Count%, X1%, Y1%, X2%, Y2%
  1510.     LINE (X1%, Y1%)-(X2%, Y2%), Hue(Mode)
  1511.     FOR I% = 1 TO Count%
  1512.         READ X%, Y%: LINE -(X%, Y%), Hue(Mode)
  1513.     NEXT I%
  1514.     LINE (0, 165)-(259, 165), Hue(Mode)
  1515.     IF Mode = 1 THEN
  1516.        Road$ = CHR$(&H22) + CHR$(11) + CHR$(&H88) + CHR$(44)
  1517.        Tree$ = CHR$(&H11) + CHR$(&H88) + CHR$(&H44) + CHR$(&H22)
  1518.        PAINT (5, 5), 2, Hue(Mode)
  1519.        PAINT (310, 100), 1, Hue(Mode)
  1520.        PAINT (250, 163), Road$, Hue(Mode)
  1521.        PAINT (10, 100), 1, Hue(Mode)
  1522.        LINE (0, 165)-(319, 165), 0
  1523.     ELSE
  1524.        PAINT (5, 5), 9, Hue(Mode)
  1525.        PAINT (310, 100), Hue(Mode), Hue(Mode)
  1526.        PAINT (250, 163), 8, Hue(Mode)
  1527.        PAINT (10, 100), Hue(Mode), Hue(Mode)
  1528.        LINE (0, 165)-(319, 165), 0
  1529.     END IF
  1530.     PSET (57, 113), Hue(Mode)
  1531.     FOR I% = 1 TO 4: READ Hue(I%): NEXT
  1532.     READ Count%, X1%, Y1%, X2%, Y2%
  1533.     LINE (X1%, Y1%)-(X2%, Y2%), Hue(Mode)
  1534.     FOR I% = 1 TO Count%
  1535.         READ X%, Y%: LINE -(X%, Y%), Hue(Mode)
  1536.     NEXT I%
  1537.     CIRCLE (127, 109), 45, Hue(Mode), 1.35, 3.1, .3
  1538.     CIRCLE (166, 102), 35, Hue(Mode), 1, 2.8, .43
  1539.     CIRCLE (214, 95), 32, Hue(Mode), 1.1, 2.8, .39
  1540.     CIRCLE (259, 94), 38, Hue(Mode), .7, 2.6, .48
  1541.     CIRCLE (296, 96), 33, Hue(Mode), .1, 1.92, .45
  1542.     IF Mode = 1 THEN
  1543.        PAINT (215, 90), Tree$, Hue(Mode)
  1544.     ELSE
  1545.        PAINT (215, 90), Hue(Mode), Hue(Mode)
  1546.     END IF
  1547.     PSET (83, 108), Hue(Mode)
  1548.     FOR I% = 1 TO 4: READ Hue(I%): NEXT
  1549.     READ Count%, X1%, Y1%, X2%, Y2%
  1550.     LINE (X1%, Y1%)-(X2%, Y2%), Hue(Mode)
  1551.     FOR I% = 1 TO Count%
  1552.         READ X%, Y%: LINE -(X%, Y%), Hue(Mode)
  1553.     NEXT I%
  1554.     LINE (270, 72)-(276, 86), Hue(Mode), BF
  1555.     PAINT (260, 95), Hue(Mode), Hue(Mode)
  1556.     IF Mode = 1 THEN
  1557.        LINE (215, 86)-(260, 73), 0: LINE -(305, 86), 0
  1558.        LINE (226, 88)-(246, 93), 1, BF: LINE (274, 88)-(294, 93), 1, BF
  1559.        LINE (255, 88)-(265, 98), 2, BF: LINE (271, 70)-(272, 71), 0, BF
  1560.        LINE (274, 70)-(275, 71), 0, BF
  1561.     ELSE
  1562.        LINE (215, 86)-(260, 73), 4: LINE -(305, 86), 4
  1563.        LINE (226, 88)-(246, 93), 26, BF: LINE (274, 88)-(294, 93), 26, BF
  1564.        LINE (255, 88)-(265, 98), 6, BF: LINE (271, 70)-(272, 71), 6, BF
  1565.        LINE (274, 70)-(275, 71), 6, BF: LINE (319, 98)-(220, 98), 8
  1566.        LINE -(186, 99), 8: LINE -(159, 101), 8: LINE -(210, 100), 8
  1567.        LINE -(319, 100), 8: PAINT (300, 99), 8, 8
  1568.     END IF
  1569.     PLAY "t255o4cdecdo3bo4co3abgt120f#at200dp8"
  1570.     FOR I% = 1 TO 4: READ Hue(I%): NEXT
  1571.     LINE (320, 102)-(285, 102), Hue(Mode)
  1572.     CIRCLE (292, 102), 6, Hue(Mode), .8, 3.1415, .7
  1573.     CIRCLE (302, 102), 9, Hue(Mode), .8, 2.5, .75
  1574.     CIRCLE (318, 102), 16, Hue(Mode), .6, 2.7, .85
  1575.     IF Mode = 1 THEN
  1576.        LINE (320, 94)-(307, 93), 1
  1577.        PAINT (310, 95), Tree$, Hue(Mode), CHR$(&HAA)
  1578.        GraPrint 256, 78, "A", GrAttrib%(0, 3), 1
  1579.        LINE (76, 6)-(244, 32), 3, BF: LINE (76, 32)-(244, 52), 1, BF
  1580.     ELSE
  1581.        PAINT (310, 100), Hue(Mode), Hue(Mode)
  1582.        IF Mode = 2 THEN
  1583.           GraPrint 495, 136, "Club-PC", GrAttrib%(1, -1), 1
  1584.        ELSEIF Mode = 3 THEN
  1585.           GraPrint 495, 190, "Club-PC", GrAttrib%(1, -1), 1
  1586.        ELSE
  1587.           GraPrint 248, 78, "CPC", GrAttrib%(27, -1), 1
  1588.        END IF
  1589.        LINE (76, 6)-(244, 32), 14, BF: LINE (76, 32)-(244, 52), 15, BF
  1590.     END IF
  1591.     Me$ = "GRAPHICS": I% = 1: X% = 80: Y% = 9
  1592.     IF Mode = 1 THEN
  1593.        Clr% = GrAttrib%(0, 3): Box% = 0
  1594.     ELSE
  1595.        Clr% = GrAttrib%(1, -1): Box% = 1
  1596.     END IF
  1597.     DO
  1598.         LINE (X%, Y%)-(X% + 20, Y% + 20), Box%, B
  1599.         IF Mode = 2 THEN
  1600.            GraPrint ((X% * 2) + 8), (Y% * 1.4) + 3, MID$(Me$, I%, 1), Clr%, 3
  1601.         ELSEIF Mode = 3 THEN
  1602.            GraPrint ((X% * 2) + 8), (Y% * 2.4) + 3, MID$(Me$, I%, 1), Clr%, 3
  1603.         ELSE
  1604.            GraPrint X% + 3, Y% + 3, MID$(Me$, I%, 1), Clr%, 2
  1605.         END IF
  1606.         I% = I% + 1: X% = X% + 20
  1607.     LOOP UNTIL I% > 8
  1608.     Me$ = "CHARACTERS": I% = 1: X% = 78: Y% = 32
  1609.     IF Mode = 1 THEN
  1610.        Clr% = GrAttrib%(2, 1)
  1611.     ELSE
  1612.        Clr% = GrAttrib%(7, -1)
  1613.     END IF
  1614.     DO
  1615.         IF Mode = 2 THEN
  1616.            GraPrint ((X% * 2) + 8), (Y% * 1.6) + 3, MID$(Me$, I%, 1), Clr%, 3
  1617.         ELSEIF Mode = 3 THEN
  1618.            GraPrint ((X% * 2) + 9), (Y% * 2.4) + 3, MID$(Me$, I%, 1), Clr%, 3
  1619.         ELSE
  1620.            GraPrint X% + 5, Y% + 3, MID$(Me$, I%, 1), Clr%, 2
  1621.         END IF
  1622.         I% = I% + 1: X% = X% + 16
  1623.     LOOP UNTIL I% > 10
  1624.     IF Mode = 1 THEN
  1625.        LINE (5, 60)-(175, 145), 0, BF: LINE (4, 59)-(176, 146), 3, B
  1626.     END IF
  1627.     I% = 1: READ Count%
  1628.     DO
  1629.         READ X%, Y%, Me$, Fore%, Back%, Scale%
  1630.         IF Mode = 2 THEN
  1631.            GraPrint X% * 2, (Y% * 1.6), Me$, GrAttrib%(Fore%, -1), Scale%
  1632.         ELSEIF Mode = 3 THEN
  1633.            GraPrint X% * 2, (Y% * 2) + 30, Me$, GrAttrib%(Fore%, -1), Scale%
  1634.         ELSE
  1635.            GraPrint X%, Y%, Me$, GrAttrib%(Fore%, Back%), Scale%
  1636.         END IF
  1637.         I% = I% + 1
  1638.     LOOP UNTIL I% > Count%
  1639.     I% = 1: READ Count%
  1640.     DO
  1641.         READ X%, Y%, Me$, Fore%, Back%, Scale%
  1642.         IF Mode = 2 THEN
  1643.            GraPrint X% * 3, (Y% * 1.4), Me$, GrAttrib%(Fore%, -1), Scale%
  1644.         ELSEIF Mode = 3 THEN
  1645.            GraPrint X% * 3, Y% * 1.92, Me$, GrAttrib%(Fore%, -1), Scale%
  1646.         ELSE
  1647.            GraPrint X%, Y%, Me$, GrAttrib%(Fore%, Back%), Scale%
  1648.         END IF
  1649.         I% = I% + 1
  1650.     LOOP UNTIL I% > Count%
  1651.     PLAY "mft255ef#gdef#gef#g#aef#g#ag#abo4co3bo4cdeco3af#gdgbt120g"
  1652.     I% = 1: READ Count%
  1653.     DO
  1654.         READ X%, Y%, Me$, Fore%, Back%, Scale%
  1655.         IF Mode = 2 THEN
  1656.            GraPrint X% * 2, Y% * 1.6, Me$, GrAttrib%(Fore%, -1), 2
  1657.         ELSEIF Mode = 3 THEN
  1658.            GraPrint X% * 2, Y% * 2.2, Me$, GrAttrib%(Fore%, -1), 2
  1659.         ELSE
  1660.            GraPrint X%, Y%, Me$, GrAttrib%(Fore%, Back%), Scale%
  1661.         END IF
  1662.         I% = I% + 1
  1663.     LOOP UNTIL I% > Count%
  1664.     DO: LOOP UNTIL KeyIn% = 32
  1665.     SCREEN 0: WIDTH 80
  1666. GOTO D001
  1667.  
  1668. '┌────────────────────────────────────────────────────────────────────────┐
  1669. '│      Video Panning.                                                    │
  1670. '└────────────────────────────────────────────────────────────────────────┘
  1671. '
  1672. D720:
  1673.     IF (MaxRes% = 13 AND VideoRam% > 64) OR MaxRes% > 9 THEN
  1674.        SCREEN 9: LINE (0, 0)-(639, 349), 9, BF
  1675.        VIEW SCREEN (40, 25)-(600, 325), 0, 15
  1676.        CIRCLE (319, 174), 150, 14: PAINT (319, 174), 14, 14
  1677.        X% = 0: Y% = 0
  1678.        DO
  1679.           KeyPress% = KeyIn%: Pan% = TRUE
  1680.           SELECT CASE KeyPress%
  1681.               CASE -75
  1682.                    IF X% > 0 THEN X% = X% - 1
  1683.               CASE -77
  1684.                    IF X% < 79 THEN X% = X% + 1
  1685.               CASE -72
  1686.                    IF Y% > 0 THEN Y% = Y% - 1
  1687.               CASE -80
  1688.                    IF Y% < 22 THEN Y% = Y% + 1
  1689.               CASE ELSE
  1690.                    Pan% = FALSE
  1691.           END SELECT
  1692.           IF Pan% THEN VGAPan X%, Y% * 5
  1693.        LOOP UNTIL KeyPress% = 27
  1694.        SCREEN 0: WIDTH 80
  1695.     ELSE
  1696.        MisTake 9, "Incompatible Video Card!", 0, Mouse%
  1697.     END IF
  1698. GOTO D001
  1699.  
  1700. '┌────────────────────────────────────────────────────────────────────────┐
  1701. '│      Video Save and Restore.                                           │
  1702. '└────────────────────────────────────────────────────────────────────────┘
  1703. '
  1704. D730:
  1705.     SELECT CASE MaxRes%
  1706.         CASE 7
  1707.              xMax% = 319: yMax% = 199: SaveSize& = 32000
  1708.         CASE 8
  1709.              xMax% = 639: yMax% = 199: SaveSize& = 64000
  1710.         CASE 9, 10
  1711.              xMax% = 639: yMax% = 349: SaveSize& = 112000
  1712.         CASE 11, 12
  1713.              xMax% = 639: yMax% = 479: SaveSize& = 153600
  1714.         CASE 13
  1715.              IF VideoRam% > 64 THEN
  1716.                 xMax% = 639: yMax% = 479: SaveSize& = 153600
  1717.                 MaxRes% = 12
  1718.              ELSE
  1719.                 xMax% = 319: yMax% = 199: SaveSize& = 64000
  1720.              END IF
  1721.         CASE ELSE
  1722.              MisTake 9, "Incompatible Video Card!", 0, Mouse%
  1723.              GOTO D002
  1724.     END SELECT
  1725.     IF Choice% = 4 THEN
  1726.        IF FreeSpace&(0) > SaveSize& THEN
  1727.           SCREEN MaxRes%: RESTORE Escher
  1728.           LINE (0, 0)-(xMax%, yMax%), 6, BF
  1729.           VIEW (32, 4)-(xMax% - 32, yMax% - 4), 0, 5
  1730.           WINDOW SCREEN (0, 0)-(255, 191)
  1731.           FOR I% = 1 TO 40
  1732.               READ A%, B%, C%, D%: LINE (A%, B%)-(C%, D%), 1
  1733.           NEXT I%
  1734.           PAINT (56, 20), 1, 1: PAINT (136, 64), 1, 1
  1735.           PAINT (120, 80), 1, 1: PAINT (192, 88), 14, 1
  1736.           PAINT (76, 48), 14, 1: PAINT (124, 60), 14, 1
  1737.           PAINT (68, 12), 2, 1: PAINT (80, 84), 2, 1
  1738.           PAINT (92, 128), 2, 1: PAINT (36, 156), 12, 1
  1739.           PAINT (36, 168), 1, 1: PAINT (84, 178), 14, 1
  1740.           PAINT (88, 118), 12, 1: PAINT (144, 86), 12, 1
  1741.           VGASave "ESCHER.IMG": KeyPress% = KeyIn%
  1742.        ELSE
  1743.           MisTake 9, "Insufficient disk space!", 0, Mouse%
  1744.        END IF
  1745.     ELSE
  1746.        IF FileSize&("ESCHER.IMG") > 0 THEN
  1747.           SCREEN MaxRes%
  1748.           VGALoad "ESCHER.IMG"
  1749.           KeyPress% = KeyIn%
  1750.        ELSE
  1751.           MisTake 9, "Screen Image file not found!", 0, Mouse%
  1752.        END IF
  1753.     END IF
  1754.     SCREEN 0: WIDTH 80
  1755. GOTO D001
  1756.  
  1757. '┌────────────────────────────────────────────────────────────────────────┐
  1758. '│      Program Exit.                                                     │
  1759. '└────────────────────────────────────────────────────────────────────────┘
  1760. '
  1761. D800:
  1762.     Menu$(0) = "ED#A"
  1763.     Menu$(1) = "&Exit program"
  1764.     Menu$(2) = "&DOS shell"
  1765.     Menu$(4) = "&About DEMON"
  1766.     VerMenu 4, 59, BarColour%, 1, 4, "EXIT", Menu$(), Choice%, Nxt%, Bar%, 1, RootName$, Mouse%, HotKeys%
  1767.     IF Nxt% THEN GOTO D002
  1768.     SELECT CASE Choice%
  1769.         CASE 1
  1770.              GOTO D810
  1771.         CASE 2
  1772.              GOTO D820
  1773.         CASE 4
  1774.              PopUp 9, 14, 9, 53, BarColour%, 1, 4, -1
  1775.              Panel 9, 14, 9, 53, 5, BarColour%
  1776.              FastPrint 9, 35, " D E M O N ", BarColour%
  1777.              RESTORE About
  1778.              READ Me$: FastPrint 11, 40 - (LEN(Me$) \ 2), Me$, BarColour%
  1779.              READ Me$: FastPrint 12, 40 - (LEN(Me$) \ 2), Me$, BarColour%
  1780.              READ Me$: FastPrint 13, 40 - (LEN(Me$) \ 2), Me$, BarColour%
  1781.              Panel 14, 34, 3, 12, 5, BarColour%
  1782.              FastPrint 15, 38, " OK ", 14: Ky% = FALSE
  1783.              IF Mouse% THEN
  1784.                 xHot% = 37 * 8: yHot% = 13 * 8
  1785.                 CALL MouseShow
  1786.              END IF
  1787.              DO
  1788.                 IF KeyStat% THEN
  1789.                    Ky% = KeyIn%
  1790.                    IF Ky% = 13 THEN
  1791.                       Panel 14, 34, 3, 12, 9, BarColour%
  1792.                    END IF   
  1793.                 ELSEIF Mouse% THEN
  1794.                    MouseNow LeftButton%, RightButton%, xMouse%, yMouse%
  1795.                    IF LeftButton% THEN
  1796.                       IF yMouse% > yHot% AND yMouse% < yHot% + 16 THEN
  1797.                          IF xMouse% > xHot% AND xMouse% < xHot% + 48 THEN
  1798.                             Panel 14, 34, 3, 12, 9, BarColour%
  1799.                             Ky% = 13
  1800.                          END IF
  1801.                       END IF
  1802.                       DO
  1803.                           MouseNow LeftButton%, RightButton%, xMouse%, yMouse%
  1804.                       LOOP WHILE LeftButton%
  1805.                    END IF
  1806.                 END IF
  1807.              LOOP UNTIL Ky% = 13
  1808.              IF Mouse% THEN MouseHide
  1809.              ShutUp -1
  1810.         CASE ELSE
  1811.     END SELECT
  1812. GOTO D002
  1813.  
  1814. '   Program Exit
  1815. '
  1816. D810:
  1817.     IF Colour% THEN
  1818.        Scroll 1, 1, 1, 25, 80, 0, Attribute%(15, 1)
  1819.        COLOR , , 1: Attrib% = 32
  1820.     ELSE
  1821.        FOR I% = 1 TO 24
  1822.            FastPrint I%, 1, STRING$(80, "░"), 7
  1823.        NEXT I%
  1824.        Attrib% = 112
  1825.     END IF
  1826.     PopUp 3, 2, 9, 44, Attrib%, 3, 2, -1: RESTORE Credits
  1827.     FOR I% = 4 TO 9
  1828.         READ Me$: FastPrint I%, 4, Me$, Attrib%
  1829.     NEXT I%
  1830.     SLEEP 5: KeyFlush
  1831.     IF Colour% THEN Attrib% = 48 ELSE Attrib% = 112
  1832.     PopUp 10, 29, 11, 50, Attrib%, 2, 1, -1
  1833.     FOR I% = 11 TO 19
  1834.         READ Me$: FastPrint I%, 31, Me$, Attrib%
  1835.     NEXT I%
  1836.     SLEEP 10: ShutUp -1: SLEEP 1: ShutUp -1: SLEEP 1
  1837.     CALL KeyFlush: CLS
  1838. GOTO Egress
  1839.  
  1840. '┌────────────────────────────────────────────────────────────────────────┐
  1841. '│      Operating System Shell.                                           │
  1842. '└────────────────────────────────────────────────────────────────────────┘
  1843. '
  1844. D820:
  1845.     FastPrint 21, 2, SPACE$(78), 31
  1846.     Me$ = "Enter the command 'EXIT' when you are ready to return."
  1847.     FastPrint 21, 40 - (LEN(Me$) \ 2), Me$, 31
  1848.     LOCATE 13, 1, 1: ON ERROR GOTO D821
  1849.     PopUp 5, 4, 15, 74, 15, 3, 0, -1
  1850.     DOSBox 1, 6, 5, 18, 75, 7
  1851.     SHELL
  1852.     DOSBox 0, 0, 0, 0, 0, 0
  1853.     LOCATE 3, 1, 0: ShutUp -1
  1854.     FastPrint 21, 2, SPACE$(78), TextColour%
  1855.     ON ERROR GOTO Trap
  1856.     GOTO D800
  1857. D821:
  1858.     ON ERROR GOTO Trap
  1859.     DOSBox 0, 0, 0, 0, 0, 0
  1860.     LOCATE 3, 1, 0: ShutUp -1
  1861.     FastPrint 21, 2, SPACE$(78), TextColour%
  1862.     IF ERR = 5 THEN
  1863.        MisTake 9, "Cannot load secondary Command Processor", 0, Mouse%
  1864.        RESUME D800
  1865.     END IF
  1866.  
  1867. '┌────────────────────────────────────────────────────────────────────────┐
  1868. '│      Error Trap.                                                       │
  1869. '└────────────────────────────────────────────────────────────────────────┘
  1870. '
  1871. Trap:
  1872.     Fatal% = TRUE
  1873.     SELECT CASE ERR
  1874.         CASE 7, 14
  1875.              Me$ = "Out of memory"
  1876.         CASE 27
  1877.              Me$ = "PRINTER NOT READY": Fatal% = FALSE
  1878.         CASE 61, 67
  1879.              Me$ = "Out of disk space"
  1880.         CASE 71
  1881.              Me$ = "DISK DRIVE NOT READY": Fatal% = FALSE
  1882.         CASE 72
  1883.              Me$ = "Disk media error"
  1884.         CASE ELSE
  1885.              A$ = STR$(ERR): Me$ = "A type" + A$ + " Error has just occurred"
  1886.     END SELECT
  1887.     IF Fatal% THEN
  1888.        Me$ = Me$ + ", aborting to DOS ..."
  1889.        SL% = StatusLine%(Me$)
  1890.        RESUME Egress
  1891.     ELSE
  1892.        ML% = LEN(Me$): MT% = 40 - (ML% \ 2)
  1893.        IF Colour% THEN Attrib% = 78 ELSE Attrib% = 112
  1894.        PopUp 9, 20, 7, 42, Attrib%, 3, 2, -1
  1895.        FastPrint 10, MT%, Me$, Attrib% + 128: BEEP
  1896.        Me$ = "Please correct this error if possible"
  1897.        FastPrint 12, 22, Me$, Attrib%
  1898.        FastPrint 13, 30, "Press a key when ready", Attrib%
  1899.        FastPrint 14, 32, "or <ESC> to Abort.", Attrib%
  1900.        Character% = KeyIn%: ShutUp -1
  1901.        IF Character% = 27 THEN RESUME Egress
  1902.        RESUME
  1903.     END IF
  1904. Egress:
  1905.     Attr% = SCREEN(20, 1, 1)
  1906.     Curtains 25, 255: Curtains 25, 31: Curtains 25, Attr%
  1907.     LOCATE 20, 1, 1: ClearEnd 1, Attr%
  1908. END
  1909.  
  1910. '┌────────────────────────────────────────────────────────────────────────┐
  1911. '│     Program specific functions and procedures.                         │
  1912. '└────────────────────────────────────────────────────────────────────────┘
  1913. '
  1914. '   Draws or refreshes the main display screen. If switch is zero, only the
  1915. '   status line is refreshed.
  1916. '
  1917. SUB Frame (Title$, Switch%) STATIC
  1918.     SHARED StatColour%, HeadColour%, TextColour%, ToDay$
  1919.     IF Switch% THEN
  1920.        Scroll 1, 1, 1, 3, 80, 0, HeadColour%
  1921.        IF Title$ <> "" THEN
  1922.           FastPrint 1, 40 - (LEN(Title$) \ 2), Title$, HeadColour%
  1923.        END IF
  1924.        FastPrint 2, 1, STRING$(80, "─"), HeadColour%
  1925.        Panel 4, 1, 21, 80, 1, TextColour%
  1926.     END IF
  1927.     FastPrint 25, 1, SPACE$(80), StatColour%
  1928.     FastPrint 25, 4, "Press <F1> for Help, <ESC> to Abort", StatColour%
  1929.     IF ToDay$ <> "" THEN
  1930.        FastPrint 25, 78 - LEN(ToDay$), ToDay$, StatColour%
  1931.     END IF
  1932. END SUB
  1933.  
  1934. '┌────────────────────────────────────────────────────────────────────────┐
  1935. '│     Data Division.                                                     │
  1936. '└────────────────────────────────────────────────────────────────────────┘
  1937. '
  1938. Blurb:
  1939.     DATA "The Library modules on this disk provide you"
  1940.     DATA "with all the facilities necessary for you to"
  1941.     DATA "implement a full range of window features in"
  1942.     DATA "your programs.  With just one statement, for"
  1943.     DATA "instance, you can 'Pop-up' a window onto the"
  1944.     DATA "screen."
  1945.     DATA "The window can be a simple rectangle, in any"
  1946.     DATA "the Visual BASIC background colors, such as "
  1947.     DATA "Alternatively it may have a border in one of"
  1948.     DATA "eight styles ...."
  1949.     DATA "The border itself may be in any one of the"
  1950.     DATA "Visual BASIC foreground colors. It can blink"
  1951.     DATA "if you want it to ..."
  1952.     DATA "The window, too, can be presented in several"
  1953.     DATA "different ways. It can be flat..."
  1954.     DATA "or it can have a black shadow underneath, to"
  1955.     DATA "give a three-dimensional effect..."
  1956.     DATA "Once you have a window on the screen, simply"
  1957.     DATA "use FASTPRINT, also in the ALTVBDOS Library,"
  1958.     DATA "to put text into it, in any colour you like."
  1959.     DATA "You can also use the SCROLL routine from the"
  1960.     DATA "same source, to clear the window's contents."
  1961.     DATA "All the functions in the Library are written"
  1962.     DATA "in fast assembly language, but this does not"
  1963.     DATA "prevent them from being very easy to use."
  1964.     DATA "This for instance, is the call to create the"
  1965.     DATA "present window ....."
  1966.     DATA "   PopUp 8, 14, 8, 52, 112, 2, 0, -1"
  1967.     DATA "Before opening a window, the function stores"
  1968.     DATA "the screen beneath it in an internal buffer."
  1969.     DATA "When you close a window, the screen contents"
  1970.     DATA "are restored to their original location. Use"
  1971.     DATA "the statement 'ShutUp -1' to close the last"
  1972.     DATA "window opened.  For example ...."
  1973.     DATA "The Library includes several functions which"
  1974.     DATA "apply windowing techniques. The HELP screen,"
  1975.     DATA "which is available at the front menu, is one"
  1976.     DATA "example. Another is the VERIFY BOX which you"
  1977.     DATA "can use to collect a Yes/No response from an"
  1978.     DATA "operator, without redrawing the display."
  1979.     DATA "Another utility is the STATUS LINE MESSAGE,"
  1980.     DATA "which can be used to pause execution of the"
  1981.     DATA "program until the operator presses a key."
  1982.     DATA "You can display any prompt message you like"
  1983.     DATA "and the function will return the ASCII code"
  1984.     DATA "of the key which was pressed."
  1985.     DATA "I often use StatusLine in conjunction with a"
  1986.     DATA "routine which checks if the printer is ready"
  1987.     DATA "or not.  This gives the user a chance to fix"
  1988.     DATA "the printer,  if it is just out of paper, or"
  1989.     DATA "to abandon printing, if it is a more serious"
  1990.     DATA "problem. PrinTest is included here too."
  1991.  
  1992. Flags:
  1993.     DATA "The ASSEMBLY-LANGUAGE TOOLBOX includes a"
  1994.     DATA "pair  of functions which give you access"
  1995.     DATA "to  the  INTRA-APPLICATION COMMUNICATION"
  1996.     DATA "AREA (IAC),  an area of memory which has"
  1997.     DATA "been reserved,  by DOS, so that programs"
  1998.     DATA "can communicate with each other. The IAC"
  1999.     DATA "is 16 bytes long and is located,  in low"
  2000.     DATA "RAM at addresses 0000:04F0 - 04FF (Hex)."
  2001.     DATA "Once set, an IAC flag retains it's value"
  2002.     DATA "until  you reset it,  or the computer is"
  2003.     DATA "rebooted."
  2004.     DATA "Since VBASIC DOS programs, compiled with"
  2005.     DATA "the /O switch to run stand-alone, cannot"
  2006.     DATA "pass variables to chain modules, you can"
  2007.     DATA "use  this feature to implement a limited"
  2008.     DATA "form of parameter passing."
  2009.     DATA "1.4F0h       9.4F8h", "2.4F1h      10.4F9h"
  2010.     DATA "3.4F2h      11.4FAh", "4.4F3h      12.4FBh"
  2011.     DATA "5.4F4h      13.4FCh", "6.4F5h      14.4FDh"
  2012.     DATA "7.4F6h      15.4FEh", "8.4F7h      16.4FFh"
  2013.     DATA 10, 59, 11, 59, 12, 59, 13, 59, 14, 59, 15, 59
  2014.     DATA 16, 59, 17, 59, 10, 72, 11, 72, 12, 72, 13, 72
  2015.     DATA 14, 72, 15, 72, 16, 72, 17, 72
  2016.  
  2017. Finder:
  2018.     DATA "This function allows you to find out if a particular"
  2019.     DATA "file is present on any disk drive in the system."," "
  2020.     DATA "Enter the name of the file which you want to locate,"
  2021.     DATA "including the drive letter and directory pathname if"
  2022.     DATA "required.  You can use an ambiguous name,  including"
  2023.     DATA "the wildcard characters (* and ?).  In this case the"
  2024.     DATA "function will pop up a directory window containing a"
  2025.     DATA "list of all files that match. You can select the one"
  2026.     DATA "you are interested in,  by high-lighting it with the"
  2027.     DATA "cursor arrow keys and pressing <RETURN>. The routine"
  2028.     DATA "returns a string containing the full pathname of the"
  2029.     DATA "file which you have selected."
  2030.  
  2031. Sorts:
  2032.     DATA "SORTFILE sorts ASCII text files. You supply the name, which may"
  2033.     DATA "include a directory pathname, and the start position and length"
  2034.     DATA "of the field which the file is to be sorted on.", " "
  2035.     DATA "The program first checks the size of the file and the amount of"
  2036.     DATA "free disk space to see if the it can be sorted in memory, this"
  2037.     DATA "requires space for two copies of the file on disk. If it is too"
  2038.     DATA "large, the file is sorted in place so that no extra disk space"
  2039.     DATA "is required. Using this method, which is far slower, the file"
  2040.     DATA "may be of any size up to 4 Gigabytes."
  2041.  
  2042. Size:
  2043.     DATA "THIS PROGRAM REPORTS THE SIZE OF FILES WHICH YOU SPECIFY"
  2044.     DATA "--------------------------------------------------------", " "
  2045.     DATA "The filename can include a directory path and may be ambiguous,"
  2046.     DATA "using the wildcard characters '*' and '?'. The program will"
  2047.     DATA "return the size of the file, in bytes, or, if more than one"
  2048.     DATA "match is found, the total size of all the files. If a size of"
  2049.     DATA "zero is returned, the file does not exist (at least not in the"
  2050.     DATA "directory specified).", " "
  2051.     DATA "Type in the pathname required (no more than 64 characters) or"
  2052.     DATA "Enter an empty string to quit."
  2053.  
  2054. KeyBuff:
  2055.     DATA 19, 6, 4, "Head Tail", 6, 33, "Keyboard Buffer"
  2056.     DATA  6, 67, "Buffer Area", 8, 4, "041A 041C"
  2057.     DATA  8, 17, "1E 20 22 24 26 28 2A 2C 2E 30 32 34 36 38 3A 3C"
  2058.     DATA  8, 68, "0480 0482", 10, 3, "┌────┬────┐"
  2059.     DATA 10, 16, "┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐"
  2060.     DATA 10, 67, "┌────┬────┐",11, 3,"│         │", 11, 16, "│"
  2061.     DATA 11, 64, "│", 11, 67, "│         │", 12, 3, "└────┴────┘"
  2062.     DATA 12, 16, "└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘"
  2063.     DATA 12, 67, "└────┴────┘", 14, 3, "ASCII Codes"
  2064.     DATA 14, 67, "Waiting", 15, 3, "Scan Codes"
  2065.  
  2066. HWare:
  2067.     DATA "Unknown computer type", "PC", "PC/XT", "PCjr"
  2068.     DATA "PC/AT, PS/2 Model 50/60", "PC/XT", "PS/2 Model 30"
  2069.     DATA "PC Convertible", "PS/2 Model 80"
  2070.  
  2071. Shift:
  2072.     DATA "Left & Right SHIFT keys pressed", "CTRL key pressed"
  2073.     DATA "ALT key pressed", "SCROLL LOCK active"
  2074.     DATA "NUM LOCK active", "CAPS LOCK active"
  2075.     DATA "INSERT key status", "Left CTRL key pressed"
  2076.     DATA "Left ALT key pressed", "SYS REQ key pressed"
  2077.     DATA "PAUSE (or CTRL-NUM LOCK) active", "SCROLL LOCK pressed"
  2078.     DATA "NUM LOCK pressed", "CAPS LOCK pressed"
  2079.     DATA "INSERT key pressed"
  2080.  
  2081. Numbers:
  2082.     DATA 8, 1, 125678, 125678, 158, 158, 158, 158, 123458, 123458
  2083.     DATA 8, 4, 1278, 1278, 18, 148, 148, 148, F, 1235678
  2084.     DATA 8, 5, 12345, 12345, 5, 5, 45678, 45678, 5, 5
  2085.     DATA 8, 6, 12348, 12348, 148, 148, 148, 148, 145678, 145678
  2086.  
  2087. Crypt:
  2088.     DATA "This routine requires that you supply two strings of
  2089.     DATA "characters. The first is the text to be encrypted, and"
  2090.     DATA "the second is one or more keywords which are used to"
  2091.     DATA "encipher the text. Thereafter, the text cannot be"
  2092.     DATA "decrypted until you supply the same key string again."
  2093.  
  2094. Strings:
  2095.     DATA "Building a 1000 element, variable-length, string array"
  2096.     DATA "in memory and filling it with random data .... "
  2097.     DATA "Sort into Ascending or Descending order (A/D) [ ]"
  2098.  
  2099. Path:
  2100.     DATA "By default, the Toolbox Help system looks for its'"
  2101.     DATA "topic files in a subdirectory called HELP, beneath"
  2102.     DATA "the currently-logged directory.  You can, however,"
  2103.     DATA "direct it to look elsewhere for files by setting a"
  2104.     DATA "HELP variable in the DOS environment table;",""
  2105.     DATA "e.g.  SET HELP=C:\BASIC\TOOLBOX\HELP",""
  2106.     DATA "Alternatively, you can use the QuickBASIC ENVIRON"
  2107.     DATA "statement within your program, to point HELPMATE to"
  2108.     DATA "the appropriate pathname. Remember, 'though, that"
  2109.     DATA "this method only remains in effect as long as the"
  2110.     DATA "current program is running."
  2111.     DATA "The current HELP environment pathname is"
  2112.     DATA "Enter replacement or press <Esc> to leave unchanged"
  2113.  
  2114. Title:
  2115.     DATA 1, 2, 2, 2, 29, 0, 92, 23, 95
  2116.     DATA 64, 98, 104, 101, 135, 103, 102, 106, 65, 112, 30, 115
  2117.     DATA 10, 119, 5, 122, 3, 125, 5, 128, 10, 131, 30, 136, 65, 142
  2118.     DATA 221, 165, 320, 165, 320, 156, 35, 125, 27, 122, 35, 119
  2119.     DATA 65, 112, 102, 106, 135, 103, 149, 102, 162, 101, 195, 98
  2120.     DATA 240, 92, 272, 90, 304, 92, 320, 94
  2121.     DATA 0, 6, 6, 167, 8, 320, 94, 304, 92
  2122.     DATA 272, 90, 240, 92, 195, 98, 162, 101, 149, 102, 135, 103
  2123.     DATA 102, 106, 82, 109
  2124.     DATA 3, 7, 7, 90, 6, 220, 85, 220, 98
  2125.     DATA 300, 98, 300, 86, 305, 86, 260, 73, 215, 86, 220, 86
  2126.     DATA 0, 6, 6, 167
  2127.  
  2128.     DATA 6
  2129.     DATA 15, 65, "Toolbox Users", 15, -1, 1
  2130.     DATA 15, 75, "register now at...", 15, -1, 1
  2131.     DATA 15, 95, "Club-PC BBS", 15, -1, 1
  2132.     DATA 15, 105, "1217 Crescent Drive", 15, -1, 1
  2133.     DATA 15, 115, "Smithfield VA 23430", 15, -1, 1
  2134.     DATA 15, 134, "Tel. (804) 357-0357", 15, -1, 1
  2135.     DATA 2
  2136.     DATA 8, 172, "for TOOLBOX support", 14, 0, 2
  2137.     DATA 8, 172, "    TOOLBOX", 13, -1, 2
  2138.     DATA 2
  2139.     DATA 39, 192, "Press the SPACE BAR to continue", 11, 0, 1
  2140.     DATA 39, 192, "          SPACE BAR", 15, -1, 1
  2141.  
  2142. Escher:
  2143.     DATA 68,4,200,76,52,12,112,44,128,52,172,76,128,52,68,84,112,44,84,60
  2144.     DATA 128,68,99,84,68,36,97,52,128,68,154,84,128,68,128,116,128,52,128
  2145.     DATA 68,68,4,52,12,172,76,142,90,142,76,142,108,142,108,200,76,200,76
  2146.     DATA 200,92,200,92,68,164,128,116,84,140,52,12,52,154,52,154,68,164
  2147.     DATA 68,164,68,100,68,36,68,84,84,45,84,76,84,109,84,140,68,100,97,116
  2148.     DATA 84,124,112,108,68,84,128,116,84,76,112,92,112,77,112,108,84,119
  2149.     DATA 92,114,142,86,151,82,180,66,186,62,186,62,236,90,236,90,68,184
  2150.     DATA 68,184,16,154,16,154,52,133,16,154,16,160,16,160,68,190,68,190
  2151.     DATA 68,184,68,190,236,96,236,96,236,90
  2152.  
  2153. About:
  2154.     DATA "Assembly-Language Toolbox demonstration program"
  2155.     DATA "(C)1992 Christy Gemmell and Singular Software"
  2156.     DATA "Release 1.03  March 1993"
  2157.  
  2158. Credits:
  2159.     DATA "   The Assembly-Language Toolbox for   "
  2160.     DATA "    Microsoft Visual BASIC for DOS     "
  2161.     DATA "              Release 1.03             "
  2162.     DATA "                                       "
  2163.     DATA "is compatible with both VBDOS Standard "
  2164.     DATA "       and Professional editions       "
  2165.  
  2166.     DATA "The Professional Edition contains source code,"
  2167.     DATA "object files, stand-alone and Quick libraries"
  2168.     DATA "and a complete set of documentation. To order"
  2169.     DATA "To order, contact:    James J. Kreyling"
  2170.     DATA "                      CPC Consulting Company"
  2171.     DATA "                      1217 Crescent Drive,"
  2172.     DATA "                      Smithfield  VA 23430"
  2173.     DATA "        or through... Club-PC BBS (8-N-1)"
  2174.     DATA "Tel (804) 357-9190    BBS (804) 357-0357"
  2175.  
  2176. '┌────────────────────────────────────────────────────────────────────────┐
  2177. '│      (C) 1993 By Christy Gemmell and Singular Software.                │
  2178. '└────────────────────────────────────────────────────────────────────────┘
  2179.